Skip to content

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

@rdspring1

Description

@rdspring1

🚀 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions