diff options
author | Mikael Olsson <mikael.olsson@arm.com> | 2023-10-30 11:10:56 +0100 |
---|---|---|
committer | Mikael Olsson <mikael.olsson@arm.com> | 2023-11-06 09:36:00 +0100 |
commit | c081e5954cd92165b139488e76bdfef1402acee6 (patch) | |
tree | 32bc237c124e21f12287150cba040c87c8e8b7e3 /driver_library/python/README.md | |
parent | 9c999fdd40c0bf2ae420f6f3bfe013dc6baa73c1 (diff) | |
download | ethos-u-linux-driver-stack-c081e5954cd92165b139488e76bdfef1402acee6.tar.gz |
Change create network UAPI to take a user buffer
To not allow the buffer for a network instance to be changed after
creation, the create network UAPI will now take the network model data
as a user buffer. The content of the user buffer is copied into an
internally allocated DMA buffer that cannot be accessed by the user.
This breaks the current API so the Linux kernel NPU driver version and
the driver library version have been given major version bumps. All the
tests, documentation and other applications affected by the changes have
been updated accordingly.
Change-Id: I25c785d75a24794c3db632e4abe5cfbb1c7ac190
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'driver_library/python/README.md')
-rw-r--r-- | driver_library/python/README.md | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/driver_library/python/README.md b/driver_library/python/README.md index 7fae749..cc67ad9 100644 --- a/driver_library/python/README.md +++ b/driver_library/python/README.md @@ -165,8 +165,8 @@ object: ```python # from file: -network_file = "/path/to/model.tflite" -network_buffer = driver.Buffer(device, network_file) +data_file = "/path/to/data.bin" +buffer = driver.Buffer(device, data_file) # from numpy: ifm_zeros = numpy.zeros(ifm_size, dtype=np.uint8) @@ -174,11 +174,15 @@ ifm_buffer = driver.Buffer(device, ifm_size) ifm_buffer.from_buffer(ifm_zeros.data) ``` -To create a network object, provide memory buffer for the model file and -created device: +To create a network object, provide the model file or a byte array with the +network data and the created device: ```python -network = driver.Network(device, network_buffer) +# from file: +network = driver.Network(device, "path/to/model.tflite") + +# from byte array: +network = driver.Network(device, network_data) ``` Inference object is instantiated with a network object and lists of input |