[GENERAL] Fix compatibility issue with older Torch versions
This commit is contained in:
committed by
Philippe Tillet
parent
f152150e7d
commit
06abc8cb40
@@ -18,8 +18,8 @@ std::shared_ptr<drv::device> host_device;
|
|||||||
std::shared_ptr<drv::context> host_context;
|
std::shared_ptr<drv::context> host_context;
|
||||||
std::shared_ptr<drv::stream> host_stream;
|
std::shared_ptr<drv::stream> host_stream;
|
||||||
|
|
||||||
int64_t cdiv_sum(torch::Tensor& x, int64_t div){
|
int64_t cdiv_sum(torch::Tensor x, int64_t div){
|
||||||
TORCH_CHECK(x.unsafeGetTensorImpl()->key_set().has(c10::DispatchKey::CPU), "Argument of cdiv_sum must be a CPU tensor")
|
TORCH_CHECK(!x.is_cuda(), "Argument of cdiv_sum must be a CPU tensor")
|
||||||
auto _x = x.accessor<int, 1>();
|
auto _x = x.accessor<int, 1>();
|
||||||
int64_t ret = 0;
|
int64_t ret = 0;
|
||||||
for(size_t i = 0; i < x.size(0); i++)
|
for(size_t i = 0; i < x.size(0); i++)
|
||||||
|
Reference in New Issue
Block a user