mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/29632 This PR is BC-breaking in the following way: Previously, C++ `torch::tensor` with a floating-point literal with no suffix (e.g. `torch::tensor(1.1)`) or a (nested) braced-init-list of floating-point literals with no suffix (e.g. `torch::tensor({{1.1, 2.2}})` produces a tensor with dtype `at::kDouble`. After this PR, it produces a tensor with dtype `torch::get_default_dtype()`, matching Python `torch.tensor` behavior. Test Plan: Imported from OSS Differential Revision: D18465819 Pulled By: yf225 fbshipit-source-id: 6834fe50335c677bc3832f2a5e9cf8d1ede9f665
10 lines
167 B
C++
10 lines
167 B
C++
#include <test/cpp/api/support.h>
|
|
|
|
namespace torch {
|
|
namespace test {
|
|
|
|
std::mutex AutoDefaultDtypeMode::default_dtype_mutex;
|
|
|
|
} // namespace test
|
|
} // namespace torch
|