5 #include "torch/csrc/autograd/generated/VariableType.h" 6 #include "torch/csrc/autograd/generated/variable_factories.h" 7 #include "torch/csrc/tensor/python_tensor.h" 8 #include "torch/csrc/utils/auto_gil.h" 9 #include "torch/csrc/utils/cuda_lazy_init.h" 11 #include <ATen/ATen.h> 16 namespace torch {
namespace autograd {
28 return torch::tensors::get_default_tensor_type();
32 if (options.
device().is_cuda()) {
33 torch::utils::cuda_lazy_init();
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...
Scalar represents a 0-dimensional tensor which contains a single element.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...