RegisterCodegenUnboxedKernels.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <torch/csrc/jit/runtime/operator.h>
  2. #include <torch/csrc/jit/runtime/custom_operator.h>
  3. #include <torch/csrc/jit/runtime/register_ops_utils.h>
  4. #include <ATen/UnboxingFunctions.h>
  5. // ${generated_comment}
  6. // NOTE [Sharded File]: This file is generated in a sharded fashion to speed up
  7. // incremental rebuilds. See the comment at the top of
  8. // templates/VariableType.cpp for an analogous, in-depth discussion.
  9. //
  10. // Generated by tools/jit/gen_unboxing.py. This file registers all ATen ops into JIT op registry instead of c10
  11. // dispatcher. JIT op registry only takes boxed kernels, so we are calling unboxing functions in UnboxingFunctions.h
  12. // to cast arguments into C++ types (instead of IValue) and delegate to unboxed kernels.
  13. namespace torch { namespace jit {
  14. using autograd::Variable;
  15. using autograd::variable_list;
  16. using at::Scalar;
  17. using at::ScalarType;
  18. using at::Tensor;
  19. using at::TensorOptions;
  20. using at::DeviceGuard;
  21. using ::c10::fmap;
  22. using ::c10::filter;
  23. namespace {
  24. RegisterOperators reg({
  25. // Generated operators
  26. ${unboxed_ops}
  27. });
  28. } // anon namespace
  29. }} // namespace torch::jit