xref: /aosp_15_r20/external/pytorch/aten/src/ATen/InitialTensorOptions.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <c10/core/TensorOptions.h>
4 
5 namespace at {
6 
7 // Represents the initial TensorOptions, before the "defaults" are ever changed.
8 // This is designed to be used in library code, where the explicit devices,
9 // dtypes, etc. are known. NOTE: this is not a stable API.
initialTensorOptions()10 inline TensorOptions initialTensorOptions() {
11   return TensorOptions(kCPU).dtype(kFloat).layout(kStrided).requires_grad(
12       false);
13 }
14 
15 } // namespace at
16