MCPcopy Create free account
hub / github.com/OAID/Tengine / SetTensorData

Method SetTensorData

core/lib/graph_executor.cpp:447–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447bool GraphExecutor::SetTensorData(Tensor* tensor, const void* input_data, int data_size)
448{
449 int tensor_size = tensor->GetTotalSize();
450
451 if(tensor_size != data_size)
452 return false;
453
454 void* tensor_addr = GetTensorBuffer(tensor);
455
456 if(tensor_addr == nullptr)
457 return false;
458
459 std::memcpy(tensor_addr, input_data, data_size);
460
461 return true;
462}
463
464bool GraphExecutor::GetTensorData(Tensor* tensor, void* output_data, int data_size)
465{

Callers

nothing calls this directly

Calls 1

GetTotalSizeMethod · 0.80

Tested by

no test coverage detected