InitialTensorOptions.h 439 B

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