pose_format.tensorflow.masked.tensor_test module
Classes:
|
Unit tests for the MaskedTensor class. |
Functions:
|
Creates a random numpy tensor and a corresponding mask. |
- class pose_format.tensorflow.masked.tensor_test.TestMaskedTensor(methodName='runTest')[source]
Bases:
TestCaseUnit tests for the MaskedTensor class.
Methods:
Test if NaN values in a MaskedTensor are fixed (removed).
Test if a MaskedTensor can be correctly cast to a float during eager execution.
Test if the computed mean of a MaskedTensor matches the numpy MaskedArray.
Test if the reshape method of a MaskedTensor produces results identical to numpy's reshape.
Test if the return type of the reshape method of a MaskedTensor is itself a MaskedTensor.
test_std()Test if the computed standard deviation of a MaskedTensor matches the numpy MaskedArray.
- test_float_eager_execution_return_type_is_correct()[source]
Test if a MaskedTensor can be correctly cast to a float during eager execution.
- test_reshape_identical_to_numpy_reshape()[source]
Test if the reshape method of a MaskedTensor produces results identical to numpy’s reshape.
- pose_format.tensorflow.masked.tensor_test.create_random_numpy_tensor_and_mask(shape, probability_for_masked, num_nans=0)[source]
Creates a random numpy tensor and a corresponding mask.
- Parameters:
shape (Tuple) – The desired shape of the tensor.
probability_for_masked (float) – The probability that an element is masked.
num_nans (int, optional) – Number of NaNs to be inserted into the tensor, default is 0.
- Returns:
A tuple containing the generated tensor and its corresponding mask.
- Return type:
Tuple[np.array, np.array]