#pragma once // This file implements tensor.h. We separated out the Tensor struct so that // other files can depend on the Tensor struct (like library.h) and the // implementations of the Tensor methods can depend on APIs in library.h // without circular dependencies. #include #include #include #include namespace torch::stable { using torch::headeronly::ScalarType; inline ScalarType Tensor::scalar_type() const { int32_t dtype; TORCH_ERROR_CODE_CHECK(aoti_torch_get_dtype(ath_.get(), &dtype)); return to(from(dtype)); } } // namespace torch::stable