Distance.h 974 B

12345678910111213141516171819202122232425
  1. #if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)
  2. #pragma once
  3. #include <ATen/native/DispatchStub.h>
  4. namespace at {
  5. class Tensor;
  6. namespace native {
  7. using pdist_forward_fn = void(*)(Tensor&, const Tensor&, const double p);
  8. using pdist_backward_fn = void(*)(Tensor&, const Tensor&, const Tensor&, const double p, const Tensor&);
  9. using cdist_fn = void(*)(Tensor&, const Tensor&, const Tensor&, const double p);
  10. using cdist_backward_fn = void(*)(Tensor&, const Tensor&, const Tensor&, const Tensor&, const double p, const Tensor&);
  11. DECLARE_DISPATCH(pdist_forward_fn, pdist_forward_stub)
  12. DECLARE_DISPATCH(pdist_backward_fn, pdist_backward_stub)
  13. DECLARE_DISPATCH(cdist_fn, cdist_stub)
  14. DECLARE_DISPATCH(cdist_backward_fn, cdist_backward_stub)
  15. }} // namespace at::native
  16. #else
  17. #error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined."
  18. #endif // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)