1 #include <ATen/core/Tensor.h> 2 #include <ATen/core/Formatting.h> 3 #include <ATen/core/Type.h> 9 void Tensor::enforce_invariants() {
10 if (impl_.get() ==
nullptr) {
11 throw std::runtime_error(
"TensorImpl with nullptr is not supported");
21 "Partially-initialized tensor not supported by at::Tensor");
24 "Partially-initialized tensor not supported by at::Tensor");
29 initializeLegacyTypeDispatchFor(*impl_);
33 void Tensor::print()
const {
35 std::cerr <<
"[" << type().toString() <<
" " << sizes() <<
"]" << std::endl;
37 std::cerr <<
"[UndefinedTensor]" << std::endl;
41 const char * Tensor::toString()
const {
42 return type().toString();
bool dtype_initialized() const noexcept
True if a tensor is dtype initialized.
bool is_variable() const noexcept
Returns true if the Tensor is actually a torch::autograd::Variable.
bool storage_initialized() const noexcept
True if a tensor is storage initialized.
Flush-To-Zero and Denormals-Are-Zero mode.