FunctionalInverses.h 797 B

1234567891011121314151617181920212223
  1. #pragma once
  2. // ${generated_comment}
  3. #include <ATen/FunctionalStorageImpl.h>
  4. #include <ATen/Tensor.h>
  5. namespace at {
  6. namespace functionalization {
  7. struct FunctionalInverses {
  8. ${view_inverse_declarations}
  9. // NB: These are not generated! They're manually implemented in the template.
  10. // TODO: Change codegen to generate these. See the following link:
  11. // https://github.com/pytorch/pytorch/blob/main/torchgen/model.py#L2583-L2585
  12. static at::Tensor chunk_inverse(const at::Tensor & base, const at::Tensor & mutated_view, InverseReturnMode inverse_return_mode, int64_t mutated_view_idx, int chunks, int dim);
  13. static at::Tensor narrow_inverse(const at::Tensor & base, const at::Tensor & mutated_view, InverseReturnMode inverse_return_mode, int dim, c10::SymInt start, c10::SymInt length);
  14. };
  15. }
  16. }