View Source tflite_beam_coral (tflite_beam v0.3.4)
Link to this section Summary
Functions
Returns TPU context or an error-tuple if requested TPU context is not available.
Creates a new interpreter instance for an Edge TPU model.
Link to this section Functions
-spec 'contains_edge_tpu_custom_op?'(#tflite_beam_flatbuffer_model{} | reference()) ->
boolean() | {error, binary()}.
-spec dequantize_tensor(reference(), non_neg_integer()) -> [number()] | {error, binary()}.
-spec dequantize_tensor(reference(),
non_neg_integer(),
{u | s, 8 | 16 | 32 | 64} |
{f, 32 | 64} |
s8 | s16 | s32 | s64 | u8 | u16 | u32 | u64 | f32 | f64 | nil) ->
[number()] | {error, binary()}.
-spec edge_tpu_devices() -> [binary()] | {error, binary()}.
-spec get_edge_tpu_context() -> {ok, reference()} | {error, binary()}.
-spec get_edge_tpu_context(list()) -> {ok, reference()} | {error, binary()}.
Returns TPU context or an error-tuple if requested TPU context is not available.
Keyword Parameters
- device
: binary()
. Possible values are
- "" -- any TPU device - "usb" -- any TPU device on USB bus - "pci" -- any TPU device on PCIe bus - ":N" -- N-th TPU device, e.g. ":0" - "usb:N" -- N-th TPU device on USB bus, e.g. "usb:0" - "pci:N" -- N-th TPU device on PCIe bus, e.g. "pci:0"
Default value is ""
.
Consider 2 USB devices and 4 PCIe devices connected to the host. The way to reference specifically USB devices:
"usb:0", "usb:1".
The way to reference specifically PCIe devices:
"pci:0", "pci:1", "pci:2", "pci:3".
The generic way to reference all devices (no assumption about device type):
":0", ":1", ":2", ":3", ":4", ":5".
- options
: map()
. Possible key-value pairs are
- "Performance": binary()
- "Low" - "Medium" - "High" - "Max"
Default is "Max".
Adjust internal clock rate to achieve different performance / power balance.
- "Usb.AlwaysDfu": boolean
- true
- false
Default is false
.
Always perform device firmware update after reset. DFU is usually only necessary after power cycle.
- "Usb.MaxBulkInQueueLength": binary()
- ["0",.., "255"] (Default is "32")
Larger queue length may improve USB performance on the direction from device to host.
All TPUs are always enumerated in the same order assuming hardware configuration does not change (no added/removed devices between enumerations). Under the assumption above, the same index N will always point to the same device.make_edge_tpu_interpreter(Tflite_beam_flatbuffer_model, EdgeTPUContext)
View Source-spec make_edge_tpu_interpreter(#tflite_beam_flatbuffer_model{} | reference(), reference()) ->
{ok, reference()} | {error, binary()}.
Creates a new interpreter instance for an Edge TPU model.
Positional Parameters
- model
: #tflite_beam_flatbuffer_model{}
. The tflite model. - edgetpu_context
: reference()
.
The Edge TPU context, from get_edge_tpu_context/1
.
nil
, the given interpreter will not resolve an Edge TPU delegate. PoseNet custom op is always supported.