ones.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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/ones_ops.h>
  16. namespace at {
  17. // aten::ones.names(int[] size, *, Dimname[]? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
  18. inline at::Tensor ones(at::IntArrayRef size, c10::optional<at::DimnameList> names, at::TensorOptions options={}) {
  19. return at::_ops::ones_names::call(size, names, optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
  20. }
  21. // aten::ones.names(int[] size, *, Dimname[]? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
  22. inline at::Tensor ones(at::IntArrayRef size, c10::optional<at::DimnameList> names, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) {
  23. return at::_ops::ones_names::call(size, names, dtype, layout, device, pin_memory);
  24. }
  25. // aten::ones(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
  26. inline at::Tensor ones(at::IntArrayRef size, at::TensorOptions options={}) {
  27. return at::_ops::ones::call(c10::fromIntArrayRefSlow(size), optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
  28. }
  29. namespace symint {
  30. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  31. at::Tensor ones(at::IntArrayRef size, at::TensorOptions options={}) {
  32. return at::_ops::ones::call(c10::fromIntArrayRefSlow(size), optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
  33. }
  34. }
  35. // aten::ones(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
  36. inline at::Tensor ones(at::IntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) {
  37. return at::_ops::ones::call(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory);
  38. }
  39. namespace symint {
  40. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  41. at::Tensor ones(at::IntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) {
  42. return at::_ops::ones::call(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory);
  43. }
  44. }
  45. // aten::ones(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
  46. inline at::Tensor ones_symint(c10::SymIntArrayRef size, at::TensorOptions options={}) {
  47. return at::_ops::ones::call(size, optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
  48. }
  49. namespace symint {
  50. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  51. at::Tensor ones(c10::SymIntArrayRef size, at::TensorOptions options={}) {
  52. return at::_ops::ones::call(size, optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
  53. }
  54. }
  55. // aten::ones(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
  56. inline at::Tensor ones_symint(c10::SymIntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) {
  57. return at::_ops::ones::call(size, dtype, layout, device, pin_memory);
  58. }
  59. namespace symint {
  60. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  61. at::Tensor ones(c10::SymIntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) {
  62. return at::_ops::ones::call(size, dtype, layout, device, pin_memory);
  63. }
  64. }
  65. // aten::ones.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  66. inline at::Tensor & ones_out(at::Tensor & out, at::IntArrayRef size) {
  67. return at::_ops::ones_out::call(c10::fromIntArrayRefSlow(size), out);
  68. }
  69. namespace symint {
  70. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  71. at::Tensor & ones_out(at::Tensor & out, at::IntArrayRef size) {
  72. return at::_ops::ones_out::call(c10::fromIntArrayRefSlow(size), out);
  73. }
  74. }
  75. // aten::ones.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  76. inline at::Tensor & ones_outf(at::IntArrayRef size, at::Tensor & out) {
  77. return at::_ops::ones_out::call(c10::fromIntArrayRefSlow(size), out);
  78. }
  79. namespace symint {
  80. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  81. at::Tensor & ones_outf(at::IntArrayRef size, at::Tensor & out) {
  82. return at::_ops::ones_out::call(c10::fromIntArrayRefSlow(size), out);
  83. }
  84. }
  85. // aten::ones.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  86. inline at::Tensor & ones_symint_out(at::Tensor & out, c10::SymIntArrayRef size) {
  87. return at::_ops::ones_out::call(size, out);
  88. }
  89. namespace symint {
  90. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  91. at::Tensor & ones_out(at::Tensor & out, c10::SymIntArrayRef size) {
  92. return at::_ops::ones_out::call(size, out);
  93. }
  94. }
  95. // aten::ones.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  96. inline at::Tensor & ones_symint_outf(c10::SymIntArrayRef size, at::Tensor & out) {
  97. return at::_ops::ones_out::call(size, out);
  98. }
  99. namespace symint {
  100. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  101. at::Tensor & ones_outf(c10::SymIntArrayRef size, at::Tensor & out) {
  102. return at::_ops::ones_out::call(size, out);
  103. }
  104. }
  105. // aten::ones.names_out(int[] size, *, Dimname[]? names, Tensor(a!) out) -> Tensor(a!)
  106. inline at::Tensor & ones_out(at::Tensor & out, at::IntArrayRef size, c10::optional<at::DimnameList> names) {
  107. return at::_ops::ones_names_out::call(size, names, out);
  108. }
  109. // aten::ones.names_out(int[] size, *, Dimname[]? names, Tensor(a!) out) -> Tensor(a!)
  110. inline at::Tensor & ones_outf(at::IntArrayRef size, c10::optional<at::DimnameList> names, at::Tensor & out) {
  111. return at::_ops::ones_names_out::call(size, names, out);
  112. }
  113. }