diff options
author | Marat Dukhan <maratek@google.com> | 2020-02-10 10:39:21 -0800 |
---|---|---|
committer | XNNPACK Team <xnnpack-github-robot@google.com> | 2020-02-10 10:39:55 -0800 |
commit | 01a1e985da7721f77f1ec29f4a06ff3dd05d604f (patch) | |
tree | 3e5506e2857f6f637d9e3c7bee85814151064e22 | |
parent | dd2b5886dac4d1f78e867eed30ee783d4c069ff4 (diff) | |
download | XNNPACK-01a1e985da7721f77f1ec29f4a06ff3dd05d604f.tar.gz |
Fix data pointers for static inputs in Subgraph API
PiperOrigin-RevId: 294252889
-rw-r--r-- | src/runtime.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime.c b/src/runtime.c index d710bf6ac..2d961abd2 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -144,7 +144,8 @@ enum xnn_status xnn_create_runtime_v2( struct xnn_blob* blob = &runtime->blobs[i]; if (value->datatype != xnn_datatype_invalid && value->type == xnn_value_type_dense_tensor) { blob->size = xnn_tensor_get_size(subgraph, i); - if (value->data == NULL) { + blob->data = (void*) value->data; + if (blob->data == NULL) { if ((value->flags & (XNN_VALUE_FLAG_EXTERNAL_INPUT | XNN_VALUE_FLAG_EXTERNAL_OUTPUT)) == 0) { // Value is purely internal to the runtime, and must be allocated in its workspace. buffer_size = round_up_po2(buffer_size + blob->size, XNN_EXTRA_BYTES); |