view_copy.h 4.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/view_copy_ops.h>
  16. namespace at {
  17. // aten::view_copy(Tensor self, SymInt[] size) -> Tensor
  18. inline at::Tensor view_copy(const at::Tensor & self, at::IntArrayRef size) {
  19. return at::_ops::view_copy::call(self, c10::fromIntArrayRefSlow(size));
  20. }
  21. namespace symint {
  22. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  23. at::Tensor view_copy(const at::Tensor & self, at::IntArrayRef size) {
  24. return at::_ops::view_copy::call(self, c10::fromIntArrayRefSlow(size));
  25. }
  26. }
  27. // aten::view_copy(Tensor self, SymInt[] size) -> Tensor
  28. inline at::Tensor view_copy_symint(const at::Tensor & self, c10::SymIntArrayRef size) {
  29. return at::_ops::view_copy::call(self, size);
  30. }
  31. namespace symint {
  32. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  33. at::Tensor view_copy(const at::Tensor & self, c10::SymIntArrayRef size) {
  34. return at::_ops::view_copy::call(self, size);
  35. }
  36. }
  37. // aten::view_copy.dtype(Tensor self, ScalarType dtype) -> Tensor
  38. inline at::Tensor view_copy(const at::Tensor & self, at::ScalarType dtype) {
  39. return at::_ops::view_copy_dtype::call(self, dtype);
  40. }
  41. // aten::view_copy.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  42. inline at::Tensor & view_copy_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef size) {
  43. return at::_ops::view_copy_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 & view_copy_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef size) {
  48. return at::_ops::view_copy_out::call(self, c10::fromIntArrayRefSlow(size), out);
  49. }
  50. }
  51. // aten::view_copy.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  52. inline at::Tensor & view_copy_outf(const at::Tensor & self, at::IntArrayRef size, at::Tensor & out) {
  53. return at::_ops::view_copy_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 & view_copy_outf(const at::Tensor & self, at::IntArrayRef size, at::Tensor & out) {
  58. return at::_ops::view_copy_out::call(self, c10::fromIntArrayRefSlow(size), out);
  59. }
  60. }
  61. // aten::view_copy.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  62. inline at::Tensor & view_copy_symint_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef size) {
  63. return at::_ops::view_copy_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 & view_copy_out(at::Tensor & out, const at::Tensor & self, c10::SymIntArrayRef size) {
  68. return at::_ops::view_copy_out::call(self, size, out);
  69. }
  70. }
  71. // aten::view_copy.out(Tensor self, SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
  72. inline at::Tensor & view_copy_symint_outf(const at::Tensor & self, c10::SymIntArrayRef size, at::Tensor & out) {
  73. return at::_ops::view_copy_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 & view_copy_outf(const at::Tensor & self, c10::SymIntArrayRef size, at::Tensor & out) {
  78. return at::_ops::view_copy_out::call(self, size, out);
  79. }
  80. }
  81. // aten::view_copy.dtype_out(Tensor self, ScalarType dtype, *, Tensor(a!) out) -> Tensor(a!)
  82. inline at::Tensor & view_copy_out(at::Tensor & out, const at::Tensor & self, at::ScalarType dtype) {
  83. return at::_ops::view_copy_dtype_out::call(self, dtype, out);
  84. }
  85. // aten::view_copy.dtype_out(Tensor self, ScalarType dtype, *, Tensor(a!) out) -> Tensor(a!)
  86. inline at::Tensor & view_copy_outf(const at::Tensor & self, at::ScalarType dtype, at::Tensor & out) {
  87. return at::_ops::view_copy_dtype_out::call(self, dtype, out);
  88. }
  89. }