Skip to content
Snippets Groups Projects
Commit 0a4677bd authored by Elizabeth's avatar Elizabeth
Browse files

Fixing tensor sizes assertion

parent dc823cd1
No related branches found
No related tags found
No related merge requests found
...@@ -329,12 +329,18 @@ extern "C"{ ...@@ -329,12 +329,18 @@ extern "C"{
void initTensorData(void* tensor_ptr, void* data_ptr, size_t size_in_bytes){ void initTensorData(void* tensor_ptr, void* data_ptr, size_t size_in_bytes){
Tensor* tensor = (Tensor*) tensor_ptr; Tensor* tensor = (Tensor*) tensor_ptr;
if(tensor->size_in_bytes != size_in_bytes){ size_t host_size_in_bytes = tensor->num_elems * 4;
//if(tensor->size_in_bytes != size_in_bytes){
if(host_size_in_bytes != size_in_bytes){
ERROR("The destination and source sizes don't match"); ERROR("The destination and source sizes don't match");
} }
std::memcpy(tensor->host_data, data_ptr, size_in_bytes); std::memcpy(tensor->host_data, data_ptr, size_in_bytes);
changeTensorPlacement(tensor, HOST);
tensor->cur_type = float_type;
} }
...@@ -428,7 +434,7 @@ extern "C"{ ...@@ -428,7 +434,7 @@ extern "C"{
bool ONLINE_PROFILING = false; bool ONLINE_PROFILING = false; // true;
void convertToFP16(struct Tensor* tensor){ void convertToFP16(struct Tensor* tensor){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment