Skip to main content

XMOS AI Tools

Project description

XMOS AI Tools

Usage

Using xformer

from xmos_ai_tools import xformer as xf

xf.convert("source model path", "converted model path", params=None)

where params is a dictionary of compiler flags and paramters and their values.

For example:

from xmos_ai_tools import xformer as xf

xf.convert("example_int8_model.tflite", "xcore_optimised_example_int8_model.tflite", {
    "mlir-disable-threading": None,
    "xcore-reduce-memory": None,
})

To see all available parameters, call

from xmos_ai_tools import xformer as xf

xf.print_help()

This will print all options available to pass to xformer. To see hidden options, run print_help(show_hidden=True)

Using the xcore tflm host interpreter

from xmos_ai_tools import xcore_tflm_host_interpreter as xtflm

ie = xtflm.XTFLMInterpreter(model_content=xformed_model)
ie.set_input_tensor(0, input_tensor)
ie.invoke()
xformer_outputs = []
for i in range(num_of_outputs):
    xformer_outputs.append(ie.get_output_tensor(i))

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

xmos_ai_tools_beta-0.1.5.dev20220320-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (35.9 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page