ott.geometry.geometry.Geometry.mask

Contents

ott.geometry.geometry.Geometry.mask#

Geometry.mask(src_mask, tgt_mask, mask_value=0.0)[source]#

Mask rows or columns of a geometry.

The mask is used only when computing some statistics of the cost_matrix.

Parameters:
  • src_mask (Optional[Array]) – Row mask. Can be specified either as a boolean array of shape [num_a,] or as an array of indices. If None, no mask is applied.

  • tgt_mask (Optional[Array]) – Column mask. Can be specified either as a boolean array of shape [num_b,] or as an array of indices. If None, no mask is applied.

  • mask_value (float) – Value to use for masking.

Return type:

Geometry

Returns:

The masked geometry.