pose_format.tensorflow.masked.tensorflow module

Classes:

MaskedTensorflow

Class that performs Tensorflow operations on MaskedTensors.

TensorflowFallback

A metaclass for managing the fallback operations on MaskedTensors with Tensorflow functions.

class pose_format.tensorflow.masked.tensorflow.MaskedTensorflow[source]

Bases: object

Class that performs Tensorflow operations on MaskedTensors. It uses the TensorflowFallback metaclass to handle functions not explicitly defined in this class.

Methods:

concat(tensors, axis)

Concatenates a list of tensors along a specified axis.

stack(tensors, axis)

Stacks a list of tensors along a specified axis.

zeros(size[, dtype])

Returns a MaskedTensor of zeros with the specified size and dtype.

static concat(tensors, axis)[source]

Concatenates a list of tensors along a specified axis.

Parameters:
  • tensors (list) – List of MaskedTensor or tensorflow.Tensor objects.

  • axis (int) – The axis along which to concatenate the tensors.

Returns:

concatenated Maskedtensor

Return type:

MaskedTensor

static stack(tensors, axis)[source]

Stacks a list of tensors along a specified axis.

Parameters:
  • tensors (list) – List of MaskedTensor objects.

  • axis (int) – The axis along which to stack the tensors.

Returns:

masekd stacked tensor.

Return type:

MaskedTensor

static zeros(size, dtype=tf.float32)[source]

Returns a MaskedTensor of zeros with the specified size and dtype.

Parameters:
  • size (tuple) – The shape of the output tensor.

  • dtype (tensorflow datatype, optional) – The datatype of the output tensor, default is tensorflow.float32.

Returns:

masked tensor of zeros.

Return type:

MaskedTensor

class pose_format.tensorflow.masked.tensorflow.TensorflowFallback[source]

Bases: type

A metaclass for managing the fallback operations on MaskedTensors with Tensorflow functions.

Attributes:

doesnt_change_mask

doesnt_change_mask = {'acos', 'asin', 'atan', 'cos', 'sin', 'sqrt', 'square', 'tan'}