mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Fix missing symbol issue when USE_NUMPY=False (#81967)
Fixes missing symbol issue if torch is built with USE_NUMPY=False. - `tensor_to_numpy` signature changed. - `warn_numpy_not_writeable` missed. Pull Request resolved: https://github.com/pytorch/pytorch/pull/81967 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
6e9b0dcdc4
commit
008bff1e03
@ -7,7 +7,7 @@
|
||||
#ifndef USE_NUMPY
|
||||
namespace torch {
|
||||
namespace utils {
|
||||
PyObject* tensor_to_numpy(const at::Tensor& tensor) {
|
||||
PyObject* tensor_to_numpy(const at::Tensor&, bool) {
|
||||
throw std::runtime_error("PyTorch was compiled without NumPy support");
|
||||
}
|
||||
at::Tensor tensor_from_numpy(
|
||||
@ -29,6 +29,10 @@ bool is_numpy_scalar(PyObject* obj) {
|
||||
at::Tensor tensor_from_cuda_array_interface(PyObject* obj) {
|
||||
throw std::runtime_error("PyTorch was compiled without NumPy support");
|
||||
}
|
||||
|
||||
void warn_numpy_not_writeable() {
|
||||
throw std::runtime_error("PyTorch was compiled without NumPy support");
|
||||
}
|
||||
} // namespace utils
|
||||
} // namespace torch
|
||||
#else
|
||||
|
Reference in New Issue
Block a user