-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap all numpy arrays as an Tensor class. #62
Comments
I'm not having a clear understanding of what this issue is fixing and what should be present in the prepared script. Can you explain in more layman terms? |
In very simplified terms, in Machine Learning, the data you have, be it training data, validation data of weights and biases are represented by Tensors. You might have seen multi-dimension arrays used quite often in Machine Learning they are actually tensors. In fact Matrices, Vectors and Scalars are all essentially tensors. Scalars are rank 0 Tensors, Vectors rank 1, Matrices rank 2 Tensors and some multi-dimensional array of N dimensions being an N rank Tensor. Currently, we are using raw NumPy arrays in our library, However, we might want to add more features to simple NumPy arrays. Hence the requirement of this issue is to create a new Tensor Class and inherit the Numpy's Array class so that our Tensor class has all the functionality of Numpy arrays, but we can add more methods into this class. You do not need to add any methods to solve this issue, pretty much a blank class with docstrings with do. For the docstring format, please refer to the current code already in the repository. |
we could implement this creating a |
I understand we could create a class, but isn't converting a NumPy array to a tensor as simple as: import numpy as np
import torch
numpy_arr = np.array(args)
tensor = torch.from_numpy(numpy_arr) |
`class Tensor:
@rohansingh9001 Here is what I tried to wrap NumPy arrays as a Tensor class. |
Currently, we are using all raw NumPy arrays in the directory.
However, we might need more functionality from these arrays specific to our class when we implement
features like Autogradient.
For now, we want to wrap all Numpy arrays in a simple Tensor class which inherits from the NumPy array class.
The text was updated successfully, but these errors were encountered: