hxtorch.perceptron.InferenceTracer

class hxtorch.perceptron.InferenceTracer

Bases: pybind11_builtins.pybind11_object

Inference tracer for a linear sequence of operations. The traced operations’ state is saved as a grenade::compute::Sequence, which can be executed as a single operation without transformation to and from PyTorch tensors. It is ensured, that no untraced modifications are made in-between traced operations by comparing the last traced operation’s output with the currently traced operation’s input value.

@note Not final API or implementation, see Issue #3694

__init__(self: _hxtorch_perceptron.InferenceTracer, filename: str)None

Construct inference tracer with filename to store traced operations to.

Methods

__init__(self, filename)

Construct inference tracer with filename to store traced operations to.

start(self)

Start tracing operations by registering tracer.

stop(self)

Stop tracing operations by deregistering tracer and save traced operations to given file.

start(self: _hxtorch_perceptron.InferenceTracer)None

Start tracing operations by registering tracer.

stop(self: _hxtorch_perceptron.InferenceTracer)List[str]

Stop tracing operations by deregistering tracer and save traced operations to given file.

@return List of traced operation names