resize.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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/resize_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. const at::Tensor & resize_(const at::Tensor & self, at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  20. return at::_ops::resize_::call(self, c10::fromIntArrayRefSlow(size), memory_format);
  21. }
  22. }
  23. namespace symint {
  24. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  25. const at::Tensor & resize_(const at::Tensor & self, c10::SymIntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  26. return at::_ops::resize_::call(self, size, memory_format);
  27. }
  28. }
  29. // aten::resize.out(Tensor self, SymInt[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
  30. inline const at::Tensor & resize_out(const at::Tensor & out, const at::Tensor & self, at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  31. return at::_ops::resize_out::call(self, c10::fromIntArrayRefSlow(size), memory_format, out);
  32. }
  33. namespace symint {
  34. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  35. const at::Tensor & resize_out(const at::Tensor & out, const at::Tensor & self, at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  36. return at::_ops::resize_out::call(self, c10::fromIntArrayRefSlow(size), memory_format, out);
  37. }
  38. }
  39. // aten::resize.out(Tensor self, SymInt[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
  40. inline const at::Tensor & resize_outf(const at::Tensor & self, at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format, const at::Tensor & out) {
  41. return at::_ops::resize_out::call(self, c10::fromIntArrayRefSlow(size), memory_format, out);
  42. }
  43. namespace symint {
  44. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  45. const at::Tensor & resize_outf(const at::Tensor & self, at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format, const at::Tensor & out) {
  46. return at::_ops::resize_out::call(self, c10::fromIntArrayRefSlow(size), memory_format, out);
  47. }
  48. }
  49. // aten::resize.out(Tensor self, SymInt[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
  50. inline const at::Tensor & resize_symint_out(const at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  51. return at::_ops::resize_out::call(self, size, memory_format, out);
  52. }
  53. namespace symint {
  54. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  55. const at::Tensor & resize_out(const at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  56. return at::_ops::resize_out::call(self, size, memory_format, out);
  57. }
  58. }
  59. // aten::resize.out(Tensor self, SymInt[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
  60. inline const at::Tensor & resize_symint_outf(const at::Tensor & self, c10::SymIntArrayRef size, c10::optional<at::MemoryFormat> memory_format, const at::Tensor & out) {
  61. return at::_ops::resize_out::call(self, size, memory_format, out);
  62. }
  63. namespace symint {
  64. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  65. const at::Tensor & resize_outf(const at::Tensor & self, c10::SymIntArrayRef size, c10::optional<at::MemoryFormat> memory_format, const at::Tensor & out) {
  66. return at::_ops::resize_out::call(self, size, memory_format, out);
  67. }
  68. }
  69. // aten::resize(Tensor self, SymInt[] size, *, MemoryFormat? memory_format=None) -> Tensor
  70. inline at::Tensor resize(const at::Tensor & self, at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  71. return at::_ops::resize::call(self, c10::fromIntArrayRefSlow(size), memory_format);
  72. }
  73. namespace symint {
  74. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  75. at::Tensor resize(const at::Tensor & self, at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  76. return at::_ops::resize::call(self, c10::fromIntArrayRefSlow(size), memory_format);
  77. }
  78. }
  79. // aten::resize(Tensor self, SymInt[] size, *, MemoryFormat? memory_format=None) -> Tensor
  80. inline at::Tensor resize_symint(const at::Tensor & self, c10::SymIntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  81. return at::_ops::resize::call(self, size, memory_format);
  82. }
  83. namespace symint {
  84. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  85. at::Tensor resize(const at::Tensor & self, c10::SymIntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt) {
  86. return at::_ops::resize::call(self, size, memory_format);
  87. }
  88. }
  89. }