Remove unused code
Closed this issue · 0 comments
jwallwork23 commented
The following code is commented out and should be removed. Similarly, for the torch_from_blob_f
header, which is unused.
Lines 112 to 138 in 2653bf8
/* | |
// Exposes the given data as a Tensor without taking ownership of the original | |
// data | |
torch_tensor_t torch_from_blob(void* data, int ndim, const int64_t* shape, | |
torch_data_t dtype, torch_device_t device) | |
{ | |
torch::Tensor* tensor = nullptr; | |
try { | |
// This doesn't throw if shape and dimensions are incompatible | |
c10::IntArrayRef vshape(shape, ndim); | |
tensor = new torch::Tensor; | |
*tensor = torch::from_blob( | |
data, vshape, | |
torch::dtype(get_dtype(dtype))).to(get_device(device)); | |
} catch (const torch::Error& e) { | |
std::cerr << "[ERROR]: " << e.msg() << std::endl; | |
delete tensor; | |
exit(EXIT_FAILURE); | |
} catch (const std::exception& e) { | |
std::cerr << "[ERROR]: " << e.what() << std::endl; | |
delete tensor; | |
exit(EXIT_FAILURE); | |
} | |
return tensor; | |
} | |
*/ |