Fifo.set_option()
Info | Value |
---|---|
Package | mvnc |
Module | mvncapi |
Version | 2.0 |
See also | Fifo, FifoOption, Fifo.get_option() |
Overview
This method sets an option value for the Fifo. The available options and possible values can be found in the FifoOption enumeration.
Syntax
fifo.set_option(option, value)
Parameters
Parameter | Type | Description |
---|---|---|
option | int | A member of the FifoOption enumeration that specifies which option value to set. |
value | varies | The new value to which the option will be set. The type to pass for this parameter depends on which option is being set. See the FifoOption enumeration for the type that corresponds to each option. |
Return
None
Raises
Exception with a Status.INVALID_PARAMETERS code if an invalid option is passed or Exception with a status code from Status if underlying function calls return a status other than Status.OK.
Notes
- All Fifo options must be set before calling Fifo.allocate(). The FifoState must be CREATED.
- Using Graph.allocate_with_fifos() to create and allocate Fifos does not allow for any Fifo options to be set other than those specified in that function’s parameters.
Example
from mvnc import mvncapi
# Initialize a Fifo
fifo = mvncapi.Fifo('', mvncapi.FifoType.HOST_RW)
# Set the Fifo data type to FP16
fifo.set_option(mvncapi.FifoOption.RW_DATA_TYPE, mvncapi.FifoDataType.FP16)
# Destroy the Fifo
fifo.destroy()