latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.masked.logaddexp
- tensorplay.masked.logaddexp(input, other, *, dtype=None, input_mask=None, other_mask=None) Tensor[source]
Returns logaddexp of all the elements in the
inputand theothertensor. Theinputelements are masked out according to the boolean tensorinput_maskand the attr:other elements are masked out according to the boolean tensorother_mask.The shapes of a mask tensor and the tensor to be masked don’t need to match, but they must be broadcastable under the standard broadcasting rules and the dimensionality of the mask tensor must not be greater than of the tensor to be masked.
- Parameters:
- Keyword Arguments:
dtype (
tensorplay.dtype, optional) – the desired data type of returned tensor. If specified, the output tensor is casted todtypeafter the operation is performed. Default: None.input_mask (
tensorplay.Tensor, optional) – the boolean tensor containing the binary mask of validity ofinputtensor elements. Default: None that is equivalent totensorplay.ones(input.shape, dtype=tensorplay.bool).other_mask (
tensorplay.Tensor, optional) – the boolean tensor containing the binary mask of validity ofothertensor elements. Default: None that is equivalent totensorplay.ones(other.shape, dtype=tensorplay.bool).
Example:
>>> input = tensorplay.tensor([-100.0, -200, -300]) >>> input tensor([-100., -200., -300.]) >>> other = tensorplay.tensor([-1.0, -2, -3]) >>> other tensor([-1., -2., -3.]) >>> mask = tensorplay.tensor([True, False, True]) >>> mask tensor([ True, False, True]) >>> tensorplay.masked._ops.logaddexp(input, other, input_mask=mask, other_mask=mask) tensor([-1., -inf, -3.])
Help improve this page
Found an error, an unclear step, or a missing example?

