to_float_mask
-
fairseq2.nn.utils.mask.to_float_mask(mask, dtype=None)[source]
Convert a boolean mask to a float mask.
- Parameters:
mask (Tensor) – The boolean mask. Shape: Any.
dtype (dtype | None) – The data type of the float mask. If None
, the default floating-point
type will be used.
- Return type:
Tensor