Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit f0d3a16

Browse files
naru-jpneaplatanios
authored andcommitted
Fix doc of mutating function in Math.swift. (#270)
1 parent ed5e615 commit f0d3a16

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Sources/TensorFlow/Operators/Math.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,27 +213,30 @@ public extension Tensor where Scalar: Numeric {
213213
return lhs - Tensor(rhs)
214214
}
215215

216-
/// Returns the tensor produced by adding the two tensors.
216+
/// Adds two tensors and stores the result in the left-hand-side variable.
217217
/// - Note: `+=` supports broadcasting.
218218
@inlinable
219219
static func += (lhs: inout Tensor, rhs: Tensor) {
220220
lhs = lhs + rhs
221221
}
222222

223-
/// Returns the scalar by adding it to every scalar of the tensor.
223+
/// Adds the scalar to every scalar of the tensor and stores the result in the left-hand-side
224+
/// variable.
224225
@inlinable
225226
static func += (lhs: inout Tensor, rhs: Scalar) {
226227
lhs = lhs + rhs
227228
}
228229

229-
/// Returns the tensor by subracting the second tensor from the first.
230+
/// Subtracts the second tensor from the first and stores the result in the left-hand-side
231+
/// variable.
230232
/// - Note: `-=` supports broadcasting.
231233
@inlinable
232234
static func -= (lhs: inout Tensor, rhs: Tensor) {
233235
lhs = lhs - rhs
234236
}
235237

236-
/// Returns the scalar by subtracting every scalar of the tensor from it.
238+
/// Subtracts the scalar from every scalar of the tensor and stores the result in the
239+
/// left-hand-side variable.
237240
@inlinable
238241
static func -= (lhs: inout Tensor, rhs: Scalar) {
239242
lhs = lhs - rhs
@@ -261,14 +264,14 @@ public extension Tensor where Scalar: Numeric {
261264
return lhs * Tensor(rhs)
262265
}
263266

264-
/// Returns the tensor produced by multiplying the two tensors.
267+
/// Multiplies two tensors and stores the result in the left-hand-side variable.
265268
/// - Note: `*=` supports broadcasting.
266269
@inlinable
267270
static func *= (lhs: inout Tensor, rhs: Tensor) {
268271
lhs = lhs * rhs
269272
}
270273

271-
/// Returns the tensor by multiplying it with the scalar, broadcasting the scalar.
274+
/// Multiplies the tensor with the scalar, broadcasting the scalar, and stores the result in the
272275
/// left-hand-side variable.
273276
@inlinable
274277
static func *= (lhs: inout Tensor, rhs: Scalar) {

0 commit comments

Comments
 (0)