aitune.torch.module.graph_spec
aitune.torch.module.graph_spec
Contains GraphSpec which represents a graph specification.
Module Contents
Classes
API
GraphSpec used to describe a computational graph.
Each torch module has its own specification of input and output variables. The input specification i.e. args and kwargs
of the torch modules forward function is represented by SampleMetadata. Those inputs can change computational
graph. AITune treats each unique input specification as a separate graph which is tuned separately. This object
represents such a computational graph with a name and input_spec information.
Return representation of GraphSpec.
Return string representation of GraphSpec.
Yield batch ranges from explicit definitions or inferred metadata.
Create GraphSpec from dictionary.
Return the minimum, optimal, and maximum shapes to use for compilation.
An explicit user definition takes precedence. Otherwise, use the recorded TensorSpec bounds with its maximum shape as the optimal shape.
Get max batch size from input spec.
Parameters:
Flag to normalize the batch size against the global batch size.
Get min batch size from input spec.
Return the explicit shape definition for an input tensor, if configured.
Return a normalized call resized to the specified batch size.
Convert the graph specification to a serializable dictionary.
Update input metadata with the specified maximum batch size.
Update input spec with other input spec.