You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Product of all elements in a tensor, and those along a given axis, just like we have sum and sum_axis.
Feature motivation
Basic tensor operation missing. I personally need it for some ML research.
(Optional) Suggest a Solution
Current workaround is tensor.log().sum().exp(), but this is slower and should not be required of the end user.
It would also be nice, although it is a separate matter, to have function to sum/prod along multiple axes at once in parallel. Otherwise you need to do two sequential tensor operations which reduces parallelism utilization.
For instance, a 3D tensor could be summed along its first two axes, perhaps like tensor.sum_axes([0, 1]);, or tensor.prod_axes([1, 3]).
The text was updated successfully, but these errors were encountered:
Feature description
Product of all elements in a tensor, and those along a given axis, just like we have
sum
andsum_axis
.Feature motivation
Basic tensor operation missing. I personally need it for some ML research.
(Optional) Suggest a Solution
Current workaround is
tensor.log().sum().exp()
, but this is slower and should not be required of the end user.It would also be nice, although it is a separate matter, to have function to sum/prod along multiple axes at once in parallel. Otherwise you need to do two sequential tensor operations which reduces parallelism utilization.
For instance, a 3D tensor could be summed along its first two axes, perhaps like
tensor.sum_axes([0, 1]);
, ortensor.prod_axes([1, 3])
.The text was updated successfully, but these errors were encountered: