1 #include <torch/extension.h> 3 #include <ATen/CPUFloatType.h> 5 #include <ATen/core/VariableHooksInterface.h> 6 #include <ATen/detail/ComplexHooksInterface.h> 8 #include <c10/core/Allocator.h> 9 #include <ATen/CPUGenerator.h> 10 #include <ATen/DeviceGuard.h> 11 #include <ATen/NativeFunctions.h> 12 #include <ATen/Utils.h> 13 #include <ATen/WrapDimUtils.h> 14 #include <c10/util/Half.h> 15 #include <c10/core/TensorImpl.h> 16 #include <c10/core/UndefinedTensorImpl.h> 17 #include <c10/util/Optional.h> 24 #include <ATen/Config.h> 35 ScalarType scalarType()
const override;
37 Backend backend()
const override;
38 const char* toString()
const override;
39 TypeID ID()
const override;
44 return at::native::empty_cpu( size, options);
50 void registerComplexTypes(
Context* context)
const override {
51 context->registerType(
56 ScalarType CPUComplexFloatType::scalarType()
const {
57 return ScalarType::ComplexFloat;
61 return scalarTypeToTypeMeta(ScalarType::ComplexFloat);
64 Backend CPUComplexFloatType::backend()
const {
68 const char* CPUComplexFloatType::toString()
const {
69 return "CPUComplexFloatType";
72 TypeID CPUComplexFloatType::ID()
const {
73 return TypeID::CPUComplexFloat;
80 PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { }
C10_NODISCARD TensorOptions device(c10::optional< Device > device) const noexcept
Return a copy of TensorOptions with device set to the given one, or cleared if device is nullopt...
Backend
This legacy enum class defines the set of backends supported by old school, code generated Type-based...
RAII guard that sets a certain default device in its constructor, and changes it back to the device t...
Flush-To-Zero and Denormals-Are-Zero mode.