fn
masked_fill_op
→TensorImplPtrint masked_fill_op(const int & a, const int & mask, double value)Python wrappers
Public Python APIs implemented by this engine symbol.Replace masked positions with a scalar value.
Returns a tensor equal to a except at positions where mask is
true, which are filled with value.
Parameters
aTensorImplPtrInput tensor.
maskTensorImplPtrBoolean mask of the same shape as
a.valuedoubleFill value (cast to the dtype of
a).Returns
TensorImplPtrTensor of the same shape and dtype as a.
Notes
Backward routes grad_out through positions where mask is false
(the values that survived the fill); positions where mask is true
receive zero gradient. Neither mask nor value is differentiable.