Conversation
|
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
LaRiffle
left a comment
There was a problem hiding this comment.
I've been dreaming of this last week! 🚀
LaRiffle
left a comment
There was a problem hiding this comment.
That's really helpful abstraction!
One last thing you can to if you want is add a method to NatvieTensor to transform a Torch Tensor to NympuTensor:
Exaample
x = th.tensor([1.])
x.numpy_tensor()If yoo find a usecase for it
Done |
| """Initializes a HookedTensor. | ||
|
|
||
| Args: | ||
| numpy_tensor (np.array): The numpy array which this tensor should wrap. |
There was a problem hiding this comment.
Hey I'm new here, but I dont see a numpy_tensor argument?
There was a problem hiding this comment.
whoops - looks like a mistake. PR welcome :)
I have created a new tensor type called NumpyTensor which will allow us to combine all tensors which utilize numpy tensors under the hood into a single abstraction.
I have initialized it with some basic functionality and future pull requests can extend it with more.