-
Notifications
You must be signed in to change notification settings - Fork 71
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
bugfix: ReduceSumStaticAxes type correction #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, @francis2tm
@@ -18,6 +18,7 @@ dependencies = [ | |||
'onnx>=1.9.0', | |||
'torch>=1.8.0', | |||
'torchvision>=0.9.0', | |||
'onnxruntime>=1.15.1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'onnxruntime>=1.15.1', |
@@ -155,7 +155,7 @@ def forward(self, input_tensor: torch.Tensor) -> torch.Tensor: # pylint: disabl | |||
|
|||
self._axes = list(range(input_tensor.dim())) | |||
|
|||
return torch.sum(input_tensor, dim=self._axes, keepdim=self._keepdims) | |||
return torch.sum(input_tensor, dim=tuple(self._axes), keepdim=bool(self._keepdims)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain why self._axes
should be wrapped into tuple?
I had the very same error message and for me the |
I am also using
Would you have any idea how to fix that? |
Hi, could you please open an issue with instructions for reproducing? |
Hello,
Bug details:
Args/Attrs to reproduce
input_tensor.shape
:torch.Size([1, 8, 8, 65])
self._axes
:[1, 2] <class 'list'>
self._keepdims
:0 <class 'int'>
Solution
My solution is a simple typecast. Only tested against my particular example.