new_zeros.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #pragma once
  2. // @generated by torchgen/gen.py from Function.h
  3. #include <ATen/Context.h>
  4. #include <ATen/DeviceGuard.h>
  5. #include <ATen/TensorUtils.h>
  6. #include <ATen/TracerMode.h>
  7. #include <ATen/core/Generator.h>
  8. #include <ATen/core/Reduction.h>
  9. #include <ATen/core/Tensor.h>
  10. #include <c10/core/Scalar.h>
  11. #include <c10/core/Storage.h>
  12. #include <c10/core/TensorOptions.h>
  13. #include <c10/util/Deprecated.h>
  14. #include <c10/util/Optional.h>
  15. #include <ATen/ops/new_zeros_ops.h>
  16. namespace at {
  17. namespace symint {
  18. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  19. at::Tensor new_zeros(const at::Tensor & self, at::IntArrayRef size, at::TensorOptions options={}) {
  20. return at::_ops::new_zeros::call(self, c10::fromIntArrayRefSlow(size), optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
  21. }
  22. }
  23. namespace symint {
  24. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  25. at::Tensor new_zeros(const at::Tensor & self, at::IntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) {
  26. return at::_ops::new_zeros::call(self, c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory);
  27. }
  28. }
  29. namespace symint {
  30. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  31. at::Tensor new_zeros(const at::Tensor & self, c10::SymIntArrayRef size, at::TensorOptions options={}) {
  32. return at::_ops::new_zeros::call(self, size, optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
  33. }
  34. }
  35. namespace symint {
  36. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  37. at::Tensor new_zeros(const at::Tensor & self, c10::SymIntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) {
  38. return at::_ops::new_zeros::call(self, size, dtype, layout, device, pin_memory);
  39. }
  40. }
  41. // aten::new_zeros.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  42. inline at::Tensor & new_zeros_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef size) {
  43. return at::_ops::new_zeros_out::call(self, c10::fromIntArrayRefSlow(size), out);
  44. }
  45. namespace symint {
  46. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  47. at::Tensor & new_zeros_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef size) {
  48. return at::_ops::new_zeros_out::call(self, c10::fromIntArrayRefSlow(size), out);
  49. }
  50. }
  51. // aten::new_zeros.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  52. inline at::Tensor & new_zeros_outf(const at::Tensor & self, at::IntArrayRef size, at::Tensor & out) {
  53. return at::_ops::new_zeros_out::call(self, c10::fromIntArrayRefSlow(size), out);
  54. }
  55. namespace symint {
  56. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  57. at::Tensor & new_zeros_outf(const at::Tensor & self, at::IntArrayRef size, at::Tensor & out) {
  58. return at::_ops::new_zeros_out::call(self, c10::fromIntArrayRefSlow(size), out);
  59. }
  60. }
  61. // aten::new_zeros.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  62. inline at::Tensor & new_zeros_symint_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef size) {
  63. return at::_ops::new_zeros_out::call(self, size, out);
  64. }
  65. namespace symint {
  66. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  67. at::Tensor & new_zeros_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef size) {
  68. return at::_ops::new_zeros_out::call(self, size, out);
  69. }
  70. }
  71. // aten::new_zeros.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  72. inline at::Tensor & new_zeros_symint_outf(const at::Tensor & self, c10::SymIntArrayRef size, at::Tensor & out) {
  73. return at::_ops::new_zeros_out::call(self, size, out);
  74. }
  75. namespace symint {
  76. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  77. at::Tensor & new_zeros_outf(const at::Tensor & self, c10::SymIntArrayRef size, at::Tensor & out) {
  78. return at::_ops::new_zeros_out::call(self, size, out);
  79. }
  80. }
  81. }