index_meta.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. // @generated by torchgen/gen.py from NativeMetaFunction.h
  3. #include <c10/core/Scalar.h>
  4. #include <c10/core/Storage.h>
  5. #include <c10/core/TensorOptions.h>
  6. #include <c10/util/Deprecated.h>
  7. #include <c10/util/Optional.h>
  8. #include <c10/core/QScheme.h>
  9. #include <ATen/core/Reduction.h>
  10. #include <ATen/TensorIterator.h>
  11. #include <ATen/TensorMeta.h>
  12. #include <tuple>
  13. #include <vector>
  14. namespace at {
  15. namespace meta {
  16. struct TORCH_API structured_index_Tensor : public TensorIteratorBase {
  17. template <bool SIZES = false, bool STRIDES = false>
  18. struct TORCH_API precompute_out {
  19. precompute_out<true, STRIDES> set_sizes(at::DimVector value) {
  20. static_assert(SIZES == false, "sizes already set");
  21. precompute_out<true, STRIDES> ret;
  22. ret.sizes = value;
  23. ret.strides = this->strides;
  24. return ret;
  25. }
  26. precompute_out<SIZES, true> set_strides(at::DimVector value) {
  27. static_assert(STRIDES == false, "strides already set");
  28. precompute_out<SIZES, true> ret;
  29. ret.sizes = this->sizes;
  30. ret.strides = value;
  31. return ret;
  32. }
  33. at::DimVector sizes;
  34. at::DimVector strides;
  35. };
  36. using meta_return_ty = precompute_out <true, true>;
  37. meta_return_ty meta(const at::Tensor & self, at::IOptTensorListRef indices);
  38. };
  39. } // namespace native
  40. } // namespace at