Skip to content

Commit 8472823

Browse files
artsterxwei
authored andcommitted
[TF] Fix Tensor.replacing(_:_:) wrong semantics. (#24635)
Swapped `self` and `other`. Now values will be replaced if mask is `true`.
1 parent c4bac79 commit 8472823

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/TensorFlow/Ops.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ public extension Tensor {
972972
vjp: _vjpReplacing where Scalar : TensorFlowFloatingPoint)
973973
func replacing(with other: Tensor,
974974
where mask: Tensor<Bool>) -> Tensor {
975-
return Raw.select(condition: mask, t: self, e: other)
975+
return Raw.select(condition: mask, t: other, e: self)
976976
}
977977
}
978978

0 commit comments

Comments
 (0)