trw.basic_typing
¶
Module Contents¶
Classes¶
Base class for protocol classes. Protocol classes are defined as: |
Attributes¶
Generic Shape |
|
Shape expressed as [N, C, D, H, W, ...] components |
|
Shape expressed as [C, D, H, W, ...] components |
|
Shape expressed as [D, H, W, ...] components |
|
Shape expressed as [N, D, H, W, ...] components (the component C is removed) |
|
Generic Tensor as numpy or torch |
|
Generic Tensor as numpy or torch. Must be shaped as [N, C, D, H, W, ...] |
|
Generic Tensor as numpy or torch. Must be shaped as [C, D, H, W, ...] |
|
Generic Tensor as numpy or torch. Must be shaped as 2D array [N, X] |
|
Generic Tensor with th N and C components removed |
|
Generic Tensor with N component only |
|
Torch Tensor. Must be shaped as [N, C, D, H, W, ...] |
|
Torch Tensor. Must be shaped as 2D array [N, X] |
|
Torch Tensor with th N and C components removed |
|
Generic Tensor with N component only |
|
Numpy Tensor. Must be shaped as [N, C, D, H, W, ...] |
|
Numpy Tensor. Must be shaped as 2D array [N, X] |
|
Numpy Tensor with th N and C components removed |
|
Represent a dictionary of (key, value) |
|
Length shaped as D, H, W, ... |
|
Represent a data split, a dictionary of any value |
|
Represent a dataset which is composed of named data splits |
|
Represent a collection of datasets |
|
- trw.basic_typing.Numeric¶
Generic Shape
- trw.basic_typing.Shape¶
Shape expressed as [N, C, D, H, W, …] components
- trw.basic_typing.ShapeNCX¶
Shape expressed as [C, D, H, W, …] components
- trw.basic_typing.ShapeCX¶
Shape expressed as [D, H, W, …] components
- trw.basic_typing.ShapeX¶
Shape expressed as [N, D, H, W, …] components (the component C is removed)
- trw.basic_typing.ShapeNX¶
Generic Tensor as numpy or torch
- trw.basic_typing.Tensor¶
Generic Tensor as numpy or torch. Must be shaped as [N, C, D, H, W, …]
- trw.basic_typing.TensorNCX¶
Generic Tensor as numpy or torch. Must be shaped as [C, D, H, W, …]
- trw.basic_typing.TensorCX¶
Generic Tensor as numpy or torch. Must be shaped as 2D array [N, X]
- trw.basic_typing.TensorNX¶
Generic Tensor with th N and C components removed
- trw.basic_typing.TensorX¶
Generic Tensor with N component only
- trw.basic_typing.TensorN¶
Torch Tensor. Must be shaped as [N, C, D, H, W, …]
- trw.basic_typing.TorchTensorNCX¶
Torch Tensor. Must be shaped as 2D array [N, X]
- trw.basic_typing.TorchTensorNX¶
Torch Tensor with th N and C components removed
- trw.basic_typing.TorchTensorX¶
Generic Tensor with N component only
- trw.basic_typing.TorchTensorN¶
Numpy Tensor. Must be shaped as [N, C, D, H, W, …]
- trw.basic_typing.NumpyTensorNCX¶
Numpy Tensor. Must be shaped as 2D array [N, X]
- trw.basic_typing.NumpyTensorNX¶
Numpy Tensor with th N and C components removed
- trw.basic_typing.NumpyTensorX¶
Represent a dictionary of (key, value)
- trw.basic_typing.Batch¶
Length shaped as D, H, W, …
- trw.basic_typing.Length¶
Represent a data split, a dictionary of any value
- trw.basic_typing.Split¶
Represent a dataset which is composed of named data splits
- trw.basic_typing.Dataset¶
- trw.basic_typing.DatasetInfo¶
Represent a collection of datasets
- trw.basic_typing.Datasets¶
- trw.basic_typing.DatasetsInfo¶
- trw.basic_typing.HistoryStep¶
- trw.basic_typing.History¶
- trw.basic_typing.Activation¶
- trw.basic_typing.IntTupleList¶
- trw.basic_typing.IntListList¶
- trw.basic_typing.ConvKernels¶
- trw.basic_typing.ConvStrides¶
- trw.basic_typing.PoolingSizes¶
- trw.basic_typing.Stride¶
- trw.basic_typing.KernelSize¶
- trw.basic_typing.Padding¶
- trw.basic_typing.Paddings¶
- class trw.basic_typing.ModuleCreator¶
Bases:
typing_extensions.Protocol
Base class for protocol classes. Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing_extensions.runtime act as simple-minded runtime protocol that checks only the presence of given attributes, ignoring their type signatures.
Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- __call__(self, *args, **kwargs) torch.nn.Module ¶