pose_format.torch.masked.torch module
Classes:
class mimicing torch functions and giving support for |
|
Meta class that gives a fallback mechanism to use torch functions on |
- class pose_format.torch.masked.torch.MaskedTorch[source]
Bases:
objectclass mimicing torch functions and giving support for
MaskedTensor.Methods:
cat(tensors, dim)Concatenate
MaskedTensorobjects along a specified dimension.squeeze(masked_tensor)Remove dimensions of size 1 from
MaskedTensor.stack(tensors, dim)Stack
MaskedTensorobjects along a new dimension.zeros(*size[, dtype])Creates a
MaskedTensorof zeros with a given shape and data type.- static cat(tensors, dim)[source]
Concatenate
MaskedTensorobjects along a specified dimension.- Parameters:
tensors (list) – List of tensors or
MaskedTensorobjects to be concatenated.dim (int) – Dimension along to concatenate.
- Returns:
Concatenated tensor.
- Return type:
- static squeeze(masked_tensor)[source]
Remove dimensions of size 1 from
MaskedTensor.- Parameters:
masked_tensor (
MaskedTensor) – tensor from which dimensions are to be removed.- Returns:
Squeezed masked tensor.
- Return type:
- static stack(tensors, dim)[source]
Stack
MaskedTensorobjects along a new dimension.- Parameters:
tensors (list) – List of
MaskedTensorobjects to be stacked.dim (int) – New dimension along which to stack.
- Returns:
Stacked maked tensor.
- Return type:
- static zeros(*size, dtype=None)[source]
Creates a
MaskedTensorof zeros with a given shape and data type.- Parameters:
*size (ints) – Dimensions of desired tensor.
dtype (torch.dtype, optional) – Data type of the tensor. If None, defaults to
torch.float.
- Returns:
masked tensor filled with zeros.
- Return type:
- class pose_format.torch.masked.torch.TorchFallback[source]
Bases:
typeMeta class that gives a fallback mechanism to use torch functions on
MaskedTensorobjects. :noindex:Attributes:
- doesnt_change_mask = {'acos', 'asin', 'atan', 'cos', 'sin', 'sqrt', 'square', 'tan', 'unsqueeze'}