BYOC: Runtime access Tensor values

Hi, I am working on a BYOC backend and finally reached the runtime level. But I’ve looked at the DNNL JSON example (I am using JSON as well) and have not found a way to access the real tensor values to serialize them for my target. From the JSON serialization I can access the shapes, etc, but not the data.

Where do I have to look for that?

The inputs are passed through NDArray in the DNNL example. You can use nd_array->data to get the data pointer.

1 Like

Here is an example of Zhi’s response. The expression data_entry_[eid]->data accesses the values of the tesnor.

1 Like

Ok, thank you, that works, but for some reason only for constant tensors.

The input tensors still have a nullpointer instead of the data field.

It should not happen because the example I pointed out was for data tensors.

Did you set inputs before running the graph runtime?

1 Like

Ah, I guess, I found my issue.

I looked into my code and did not a line, that initializes the input tensors. But the ACL and DNNL Json implementations do not contain anything like this as well.