-
Notifications
You must be signed in to change notification settings - Fork 46
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
Reshape: what if |newShape| is a scalar number #452
Comments
Just to make sure I'm following along, this proposes: partial interface MLGraphBuilder {
- MLOperand reshape(MLOperand input, sequence<unsigned long> newShape);
+ MLOperand reshape(MLOperand input, (unsigned long or sequence<unsigned long>) newShape);
}; And the behavior of |
It seems confusing. I am not aware any examples to use scalar number to represent shape. @BruceDai , could you please clarify your proposal? |
I'm not aware of models that make use of scalar shape. What is the semantic difference between Torch and Numpy seems to treat >>> np.random.rand(1,3,4,4).reshape(48).shape
(48,) // <- The returned shape is a sequence of integers
>>> torch.rand((1,3,4,4)).reshape(48).shape
torch.Size([48]) // <- The returned shape is a sequence of integers |
Actually this proposal was from @zolkis's #446.
In #476, it removed the step for |newShape| being a scalar, - If |newShape| is a scalar [=number=], set |outputShape| to the [=/list=] « 1 ». so current the declarations of |newShape| match below algorithm steps. |
Thanks @BruceDai , then this can be closed. |
Originally posted by @BruceDai in #446 (comment)
The text was updated successfully, but these errors were encountered: