6. PopEF Python API reference

6.1. PopEF Metadata

class popef.BlobType

Members:

POPLAR_EXECUTABLE

METADATA

DATA_TENSOR

DATA_FEED

OPAQUE

property name
class popef.DataType

Members:

BOOL

F8

F16

F32

F64

S8

U8

S16

U16

S32

U32

S64

U64

property name
class popef.TensorType

Members:

UNKNOWN

INPUT

OUTPUT

property name
class popef.Option
__init__(self: popef.Option) None
name(self: popef.Option) str
setName(self: popef.Option, arg0: str) None
setValue(self: popef.Option, arg0: str) None
value(self: popef.Option) str
class popef.ProgramFlow
__init__(self: popef.ProgramFlow) None
load(self: popef.ProgramFlow) List[int]
main(self: popef.ProgramFlow) List[int]
save(self: popef.ProgramFlow) List[int]
setLoad(self: popef.ProgramFlow, arg0: List[int]) None
setMain(self: popef.ProgramFlow, arg0: List[int]) None
setSave(self: popef.ProgramFlow, arg0: List[int]) None
class popef.TensorInfo
__init__(self: popef.TensorInfo) None
dataType(self: popef.TensorInfo) popef.DataType
dataTypePythonFormat(self: popef.TensorInfo) str
numpyDType(self: popef.TensorInfo) dtype
setDataType(self: popef.TensorInfo, arg0: popef.DataType) None
setShape(self: popef.TensorInfo, arg0: List[int]) None
shape(self: popef.TensorInfo) List[int]
sizeInBytes(self: popef.TensorInfo) int
class popef.TensorDataInfo
__init__(self: popef.TensorDataInfo) None
name(self: popef.TensorDataInfo) str
setName(self: popef.TensorDataInfo, arg0: str) None
setTensorInfo(self: popef.TensorDataInfo, arg0: popef.TensorInfo) None
tensorInfo(self: popef.TensorDataInfo) popef.TensorInfo
class popef.FeedDataInfo
__init__(self: popef.FeedDataInfo) None
name(self: popef.FeedDataInfo) str
numTensors(self: popef.FeedDataInfo) int
setName(self: popef.FeedDataInfo, arg0: str) None
setNumTensors(self: popef.FeedDataInfo, arg0: int) None
setTensorInfo(self: popef.FeedDataInfo, arg0: popef.TensorInfo) None
tensorInfo(self: popef.FeedDataInfo) popef.TensorInfo
class popef.Metadata
__init__(self: popef.Metadata) None
anchors(self: popef.Metadata) List[popef.Anchor]
deviceOptions(self: popef.Metadata) List[popef.Option]
engineOptions(self: popef.Metadata) List[popef.Option]
executable(self: popef.Metadata) str
ipuVersion(self: popef.Metadata) int
isInference(self: popef.Metadata) bool
isPOD(self: popef.Metadata) bool
numIpus(self: popef.Metadata) int
numProcesses(self: popef.Metadata) int
programFlow(self: popef.Metadata) popef.ProgramFlow
programsMap(self: popef.Metadata) Dict[int, str]
replicationFactor(self: popef.Metadata) int
seedHandle(self: popef.Metadata) str
setAnchors(self: popef.Metadata, arg0: List[popef.Anchor]) None
setDeviceOptions(self: popef.Metadata, arg0: List[popef.Option]) None
setEngineOptions(self: popef.Metadata, arg0: List[popef.Option]) None
setExecutable(self: popef.Metadata, arg0: str) None
setIpuVersion(self: popef.Metadata, arg0: int) None
setIsInference(self: popef.Metadata, arg0: bool) None
setIsPOD(self: popef.Metadata, arg0: bool) None
setNumIpus(self: popef.Metadata, arg0: int) None
setNumProcesses(self: popef.Metadata, arg0: int) None
setProgramFlow(self: popef.Metadata, arg0: popef.ProgramFlow) None
setProgramsMap(self: popef.Metadata, arg0: Dict[int, str]) None
setReplicationFactor(self: popef.Metadata, arg0: int) None
setSeedHandle(self: popef.Metadata, arg0: str) None
class popef.Anchor
__init__(self: popef.Anchor) None
handle(self: popef.Anchor) str
isPerReplica(self: popef.Anchor) bool
name(self: popef.Anchor) str
programs(self: popef.Anchor) List[int]
repeats(self: popef.Anchor) int
setHandle(self: popef.Anchor, arg0: str) None
setIsPerReplica(self: popef.Anchor, arg0: bool) None
setName(self: popef.Anchor, arg0: str) None
setPrograms(self: popef.Anchor, arg0: List[int]) None
setRepeats(self: popef.Anchor, arg0: int) None
setTensorInfo(self: popef.Anchor, arg0: popef.TensorInfo) None
setType(self: popef.Anchor, arg0: popef.TensorType) None
setUseRemoteBuffers(self: popef.Anchor, arg0: bool) None
tensorInfo(self: popef.Anchor) popef.TensorInfo
type(self: popef.Anchor) popef.TensorType
useRemoteBuffers(self: popef.Anchor) bool

6.2. Classes for writing PopEF streams

class popef.WritingMode

Members:

OVERWRITE

APPEND

property name
class popef.BlobWriter
close(self: popef.BlobWriter) None
write(self: popef.BlobWriter, arg0: str, arg1: int) None
class popef.MultiFeedWriter
addFeed(self: popef.MultiFeedWriter, arg0: popef.FeedDataInfo) None
close(self: popef.MultiFeedWriter) None
write(self: popef.MultiFeedWriter, arg0: str, arg1: str, arg2: int) None
class popef.Writer
__init__(self: popef.Writer, filename: str, mode: popef.WritingMode = <WritingMode.OVERWRITE: 0>) None
close(self: popef.Writer) None
createExecutable(self: popef.Writer, arg0: str, arg1: bool) popef.BlobWriter
createFeedData(self: popef.Writer, arg0: popef.FeedDataInfo) popef.BlobWriter
createMultiFeedData(self: popef.Writer) popef.MultiFeedWriter
createOpaqueBlob(self: popef.Writer, arg0: str, arg1: str) popef.BlobWriter
createTensorData(self: popef.Writer, arg0: popef.TensorDataInfo) popef.BlobWriter
setVersion(self: popef.Writer, arg0: str) None
writeMetadata(self: popef.Writer, arg0: popef.Metadata) None

6.3. Classes for reading PopEF streams

class popef.TensorReader
data(self: popef.TensorReader) numpy.ndarray
class popef.FeedReader
data(self: popef.FeedReader) List[numpy.ndarray]
class popef.OpaqueReader
data(self: popef.OpaqueReader) bytes
class popef.ExecutableReader
executable(self: popef.ExecutableReader) bytes
class popef.Reader
__init__(self: popef.Reader) None
executables(self: popef.Reader) List[popef.ExecutableReader]
feeds(self: popef.Reader) List[popef.FeedReader]
metadata(self: popef.Reader) List[popef.Metadata]
opaqueBlobs(self: popef.Reader) List[popef.OpaqueReader]
parseFile(self: popef.Reader, arg0: str) None
tensors(self: popef.Reader) List[popef.TensorReader]

6.4. Model representation classes

class popef.Model
__init__(self: popef.Model, arg0: popef.ExecutableReader, arg1: popef.Metadata) None