Fix a memleak in pybind. (#2503)

This commit is contained in:
Dmitri Smirnov 2019-11-27 15:32:05 -08:00 committed by GitHub
parent 1fdf1006ac
commit 75b4747701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -233,7 +233,7 @@ void CreateSequenceOfTensors(AllocatorPtr alloc, const std::string& name_input,
throw std::runtime_error("CreateSequenceOfTensors: Input is not a tensor");
}
auto p_tensor = CreateTensor(alloc, name_input, reinterpret_cast<PyArrayObject*>(py_obj));
p_seq_tensors->tensors[i] = std::move(*(p_tensor.release()));
p_seq_tensors->tensors[i] = std::move(*p_tensor);
}
}