csarofeen / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
http://pytorch.org
Other
26 stars 7 forks source link

Return a copy for integer data types with 'trunc' operation. #2499

Open rdspring1 opened 1 year ago

rdspring1 commented 1 year ago

🚀 The feature, motivation and pitch

For integer inputs, we should return a copy of the input tensor.

Reference: https://pytorch.org/docs/stable/generated/torch.trunc.html

Currently, we fail to compile if we pass an integer argument.

CUDA NVRTC compile error: __tmp_kernel3.cu(9229): error: more than one instance of overloaded function "trunc" matches the argument list:
            function "trunc(double)"
__nv_nvrtc_builtin_header.h(167045):
            function "trunc(float)"
__nv_nvrtc_builtin_header.h(168058):
            argument types are: (int)

Alternatives

No response

Additional context

No response