attribute
SpecType
PythonSpecType = list[npt.ArrayLike] | tuple[npt.ArrayLike] | dict[str, npt.ArrayLike] | npt.ArrayLikeThis module provides utility functions for working with tensors.
Functions
| Name | Description |
|---|---|
matches_spec |
Test whether data object matches the desired spec |
SpecTypeattributematches_specfunctionTest whether data object matches the desired spec.SpecType = list[npt.ArrayLike] | tuple[npt.ArrayLike] | dict[str, npt.ArrayLike] | npt.ArrayLikeTest whether data object matches the desired spec.
matches_spec(o: SpecType, spec: SpecType, ignore_batch_dim: bool = False) -> boolTest whether data object matches the desired spec.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
o | SpecType | Required | Data object. |
spec | SpecType | Required | Metadata for describing the the data object. |
ignore_batch_dim | bool | False | Ignore first dimension when checking shapes. |
Returns
| Value | Type | Description |
|---|---|---|
bool | bool | If matches |