tensor_split.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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/tensor_split_ops.h>
  16. namespace at {
  17. // aten::tensor_split.sections(Tensor(a -> *) self, SymInt sections, int dim=0) -> Tensor(a)[]
  18. inline ::std::vector<at::Tensor> tensor_split(const at::Tensor & self, int64_t sections, int64_t dim=0) {
  19. return at::_ops::tensor_split_sections::call(self, sections, dim);
  20. }
  21. namespace symint {
  22. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  23. ::std::vector<at::Tensor> tensor_split(const at::Tensor & self, int64_t sections, int64_t dim=0) {
  24. return at::_ops::tensor_split_sections::call(self, sections, dim);
  25. }
  26. }
  27. // aten::tensor_split.sections(Tensor(a -> *) self, SymInt sections, int dim=0) -> Tensor(a)[]
  28. inline ::std::vector<at::Tensor> tensor_split_symint(const at::Tensor & self, c10::SymInt sections, int64_t dim=0) {
  29. return at::_ops::tensor_split_sections::call(self, sections, dim);
  30. }
  31. namespace symint {
  32. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  33. ::std::vector<at::Tensor> tensor_split(const at::Tensor & self, c10::SymInt sections, int64_t dim=0) {
  34. return at::_ops::tensor_split_sections::call(self, sections, dim);
  35. }
  36. }
  37. // aten::tensor_split.indices(Tensor(a -> *) self, SymInt[] indices, int dim=0) -> Tensor(a)[]
  38. inline ::std::vector<at::Tensor> tensor_split(const at::Tensor & self, at::IntArrayRef indices, int64_t dim=0) {
  39. return at::_ops::tensor_split_indices::call(self, c10::fromIntArrayRefSlow(indices), dim);
  40. }
  41. namespace symint {
  42. template <typename T, typename = std::enable_if_t<std::is_same<T, int64_t>::value>>
  43. ::std::vector<at::Tensor> tensor_split(const at::Tensor & self, at::IntArrayRef indices, int64_t dim=0) {
  44. return at::_ops::tensor_split_indices::call(self, c10::fromIntArrayRefSlow(indices), dim);
  45. }
  46. }
  47. // aten::tensor_split.indices(Tensor(a -> *) self, SymInt[] indices, int dim=0) -> Tensor(a)[]
  48. inline ::std::vector<at::Tensor> tensor_split_symint(const at::Tensor & self, c10::SymIntArrayRef indices, int64_t dim=0) {
  49. return at::_ops::tensor_split_indices::call(self, indices, dim);
  50. }
  51. namespace symint {
  52. template <typename T, typename = std::enable_if_t<std::is_same<T, c10::SymInt>::value>>
  53. ::std::vector<at::Tensor> tensor_split(const at::Tensor & self, c10::SymIntArrayRef indices, int64_t dim=0) {
  54. return at::_ops::tensor_split_indices::call(self, indices, dim);
  55. }
  56. }
  57. // aten::tensor_split.tensor_indices_or_sections(Tensor(a -> *) self, Tensor tensor_indices_or_sections, int dim=0) -> Tensor(a)[]
  58. inline ::std::vector<at::Tensor> tensor_split(const at::Tensor & self, const at::Tensor & tensor_indices_or_sections, int64_t dim=0) {
  59. return at::_ops::tensor_split_tensor_indices_or_sections::call(self, tensor_indices_or_sections, dim);
  60. }
  61. }