Skip to content
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

[CherryPick] Inductor cpp wrapper: fix dtype of ShapeAsConstantBuffer (#122297) #123064

Merged
merged 1 commit into from Apr 2, 2024

Commits on Apr 1, 2024

  1. Inductor cpp wrapper: fix dtype of ShapeAsConstantBuffer (pytorch#122297

    )
    
    For `at::scalar_tensor` the default dtype will be `float` ([link to scalar_tensor](https://github.com/pytorch/pytorch/blob/0d8e960f74acd359358e0b729c4803d2b71849e5/aten/src/ATen/native/TensorFactories.cpp#L856), [link to default dtype](https://github.com/pytorch/pytorch/blob/0d8e960f74acd359358e0b729c4803d2b71849e5/c10/core/TensorOptions.h#L551)) if we don't set the `dtype` value. However, the input scalar value is not necessarily a `float` value. With `torch::tensor(x)`, the dtype of the tensor will be decided according to the dtype of the scalar.
    
    Pull Request resolved: pytorch#122297
    Approved by: https://github.com/jgong5, https://github.com/desertfire
    chunyuan-w committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    0542353 View commit details
    Browse the repository at this point in the history