-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Checking the first dimensions of a tensor #25
Comments
Hi there; I'm glad you like the library. So the answer is that handling the general case for As a result, This is the case As a fix, you can use If you have the energy this is something I'd be happy to accept a PR on. |
Thanks for the quick response. I see, I didn't think about the general case. I knew about the For the moment, I will leave those cases unchecked and if I find some time in the following weeks I will try to solve this case myself and send a PR 💪🏼 |
@patrick-kidger I understand how the case of |
So it's definitely possible to support |
Hi!
I just found torchtyping a few days ago, and I am enjoying it so far. However, I am a bit confused when it comes to one particular use-case: checking if the arguments of a function share the same first dimensions.
For example, if I try to write a function such as batch-wise scalar multiplication:
I get a
NotImplementedError
:Having dimensions to the left of ... is not currently supported
.Why is such a behaviour not implemented? What is the difference from performing the same operation on the right?
While I haven't checked the code, to the best of my understanding if
TensorType[..., 'B']
is supported, then if you detect a situation likeTensorType[..., 'B']
, you should be able to reuse the same code but reading the tensors backwards, isn't it?I feel this feature would be huge for the library. At least with my programming conventions, I tend to put common dimensions in leading positions so that later I can unpack tensors using the
*
operator.The text was updated successfully, but these errors were encountered: