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

Commit 2750afc

Browse files
authored
tests: remove extraneous parenthesis (#925)
Clean up some extraneous parenthesis and add some missing whitespace.
1 parent 0fdb39d commit 2750afc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Tests/TensorFlowTests/EpochsTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,25 @@ final class EpochsTests: XCTestCase {
8989

9090
// `inBatches` is lazy so no elements were accessed.
9191
XCTAssert(
92-
dataset.accessed.allSatisfy(){ !$0 },
92+
dataset.accessed.allSatisfy { !$0 },
9393
"No elements should have been accessed yet.")
9494
for (i, batch) in batches.enumerated() {
9595
// Elements are not accessed until we do something with `batch` so only
9696
// the elements up to `i * batchSize` have been accessed yet.
9797
XCTAssert(
98-
dataset.accessed[..<(i * batchSize)].allSatisfy(){ $0 },
98+
dataset.accessed[..<(i * batchSize)].allSatisfy { $0 },
9999
"Not all elements prior to \(i * batchSize) have been accessed.")
100100
XCTAssert(
101-
dataset.accessed[(i * batchSize)...].allSatisfy(){ !$0 },
101+
dataset.accessed[(i * batchSize)...].allSatisfy { !$0 },
102102
"Some elements after \(i * batchSize) have been accessed.")
103103
let _ = Array(batch)
104104
let limit = (i + 1) * batchSize
105105
// We accessed elements up to `limit` but no further.
106106
XCTAssert(
107-
dataset.accessed[..<limit].allSatisfy(){ $0 },
107+
dataset.accessed[..<limit].allSatisfy { $0 },
108108
"Not all elements prior to \(limit) have been accessed.")
109109
XCTAssert(
110-
dataset.accessed[limit...].allSatisfy(){ !$0 },
110+
dataset.accessed[limit...].allSatisfy { !$0 },
111111
"Some elements after \(limit) have been accessed.")
112112
}
113113
}
@@ -178,7 +178,7 @@ final class EpochsTests: XCTestCase {
178178

179179
// `inBatches` is lazy so no elements were accessed.
180180
XCTAssert(
181-
dataset.accessed.allSatisfy(){ !$0 },
181+
dataset.accessed.allSatisfy { !$0 },
182182
"No elements should have been accessed yet.")
183183
for batches in epochs {
184184
for (i, batch) in batches.enumerated() {
@@ -223,7 +223,7 @@ final class EpochsTests: XCTestCase {
223223
for k in 0..<64 {
224224
let currentShape = nonuniformDataset[i * 64 + k].shape[0]
225225
let paddedPart =
226-
atStart ? b[k, 0..<(expectedShape-currentShape)] : (b[k, currentShape..<expectedShape])
226+
atStart ? b[k, 0..<(expectedShape - currentShape)] : (b[k, currentShape..<expectedShape])
227227
XCTAssertEqual(
228228
paddedPart,
229229
Tensor<Int32>(

0 commit comments

Comments
 (0)