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