Conformance tooling

torch_lattice_conformance.cli.main(argv=None)[source]
Return type:

None

Parameters:

argv (Sequence[str] | None)

class torch_lattice_conformance.generate.SparseInputSpec(channels, batch_size, spatial_shape, rows_per_batch, dtype=torch.float32, stride=(1, 1, 1))[source]

Bases: object

Parameters:
channels: int
batch_size: int
spatial_shape: tuple[int, int, int]
rows_per_batch: tuple[int, ...]
dtype: dtype = torch.float32
stride: tuple[int, int, int] = (1, 1, 1)
class torch_lattice_conformance.generate.FuzzCase(name, family, seed, output_kind, input_mode, rtol, atol, metadata)[source]

Bases: object

Parameters:
  • name (str)

  • family (Literal['sparse_classifier', 'sparse_feature_chain', 'sparse_branch', 'target_branch', 'transpose_chain', 'generative_transpose', 'point_voxel', 'quantized_classifier'])

  • seed (int)

  • output_kind (Literal['dense', 'sparse'])

  • input_mode (Literal['sparse_kwargs', 'dense_kwargs'])

  • rtol (float)

  • atol (float)

  • metadata (dict[str, Any])

name: str
family: Literal['sparse_classifier', 'sparse_feature_chain', 'sparse_branch', 'target_branch', 'transpose_chain', 'generative_transpose', 'point_voxel', 'quantized_classifier']
seed: int
output_kind: Literal['dense', 'sparse']
input_mode: Literal['sparse_kwargs', 'dense_kwargs']
rtol: float
atol: float
metadata: dict[str, Any]
class torch_lattice_conformance.generate.SparseChainModel(stages, *, global_pool=None, head=None)[source]

Bases: Module

Parameters:
  • stages (list[nn.Module])

  • global_pool (nn.Module | None)

  • head (nn.Module | None)

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Parameters:

x (SparseTensor)

class torch_lattice_conformance.generate.SparseBranchModel(left, right, tail, *, merge, join)[source]

Bases: Module

Parameters:
  • left (nn.Module)

  • right (nn.Module)

  • tail (nn.Module)

  • merge (Literal['add', 'cat'])

  • join (Literal['inner', 'outer'])

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

SparseTensor

Parameters:

x (SparseTensor)

class torch_lattice_conformance.generate.TargetBranchModel(pre, target_conv)[source]

Bases: Module

Parameters:
  • pre (nn.Module)

  • target_conv (spnn.TargetConv3d)

forward(x, target)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

SparseTensor

Parameters:
class torch_lattice_conformance.generate.PointVoxelRoundTrip(*, voxel_size, origin, reduction, interpolation)[source]

Bases: Module

Parameters:
forward(points, features, batch_indices, active_rows)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:
torch_lattice_conformance.generate.main()[source]
Return type:

None

torch_lattice_conformance.e2e.main()[source]
Return type:

None

class torch_lattice_conformance.e2e.SparseClassifier[source]

Bases: Module

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:

x (SparseTensor)

class torch_lattice_conformance.e2e.QuantizedClassifier[source]

Bases: Module

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:

x (SparseTensor)

class torch_lattice_conformance.e2e.TargetBranch[source]

Bases: Module

forward(x, target)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

SparseTensor

Parameters:
class torch_lattice_conformance.e2e.PointVoxel(*args, **kwargs)[source]

Bases: Module

Parameters:
forward(points, features, batch_indices, active_rows)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:
class torch_lattice_conformance.e2e.TransposeConvolution[source]

Bases: Module

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

SparseTensor

Parameters:

x (SparseTensor)

class torch_lattice_conformance.e2e.GenerativeTransposeConvolution[source]

Bases: Module

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

SparseTensor

Parameters:

x (SparseTensor)

class torch_lattice_conformance.migration.CompatCase(family, seed, output_kind)[source]

Bases: object

Parameters:
  • family (Literal['pointwise_chain', 'branch_add', 'branch_cat', 'global_pool', 'batchnorm_chain', 'spatial_subm_mapping', 'stride2_forward'])

  • seed (int)

  • output_kind (Literal['sparse', 'dense'])

family: Literal['pointwise_chain', 'branch_add', 'branch_cat', 'global_pool', 'batchnorm_chain', 'spatial_subm_mapping', 'stride2_forward']
seed: int
output_kind: Literal['sparse', 'dense']
torch_lattice_conformance.migration.main()[source]
Return type:

None