Dfp#
- class Dfp(path_or_bytes: str | Path | bytearray)#
A container class for the DFP that provides easy access to metadata like input/output shapes, number of MXAs etc.
- Parameters:
- path_or_bytes: str/pathlib.Path
Path to a .dfp file or DFP bytearray
Examples
nc = NeuralCompiler(models='/models/mobilenet.h5', num_chips=4) dfp = nc.run() dfp.num_chips # 4 dfp.num_inports # 1 dfp.num_outports # 1 dfp.input_shapes # [[224,224,1,3]] dfp.output_shapes # [[1,1,1,1000]] dfp.write(file_name) # -> file_name.dfp
- property version#
Returns the DFP version
- property num_inports#
Returns the number of active/used input ports
- property num_outports#
Returns the number of active/used output ports
- property input_shapes#
Returns a list of feature map shapes of the active/used input ports
- property input_ports#
Returns a dictionary of metadata of the active/used input ports
- property output_ports#
Returns a dictionary of metadata of the active/used output ports
- property output_shapes#
Returns a list of feature map shapes of the active/used output ports
- property num_chips#
Returns the number of MXAs the DFP was compiled for
- property chip_gen#
Returns the generation of the MXA the DFP was compiled for
- property models#
Returns a list of paths/type information of the models compiled in the DFP
- write(fname)#
Writes the DFP contents to a file
- Parameters:
- fname: str/pathlib.Path
Path to write/save the DFP on disk
See also
