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
Basically, I want to convert torch.sum(tensor, 1). tch::Tensor has a sum(dtype) method which doesn't allow to specify which dimension to reduce along: it reduces along all of them, like torch.sum does when no dim is passed.
I guess the correct method to call is sum_dim_intlist, however dim must implement Into<Option<&'a [i64]>>, which forces to use a slice. Isn't there anything simpler than this call ?
I think you're right and that's the appropriate way to do it, I wouldn't know about a simpler way now but I've just prototype in #621 a way to simplify this and allow one to write the following:
some_tensor.sum_dim_intlist(1,false,Kind::Int64)
However this is a bit of a breaking change so we probably want to think a bit more about it (besides only making it a major revision change which is already the case).
Basically, I want to convert
torch.sum(tensor, 1)
.tch::Tensor
has asum(dtype)
method which doesn't allow to specify which dimension to reduce along: it reduces along all of them, liketorch.sum
does when nodim
is passed.I guess the correct method to call is
sum_dim_intlist
, howeverdim
must implementInto<Option<&'a [i64]>>
, which forces to use a slice. Isn't there anything simpler than this call ?The text was updated successfully, but these errors were encountered: