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

Commit b87ed94

Browse files
committed
WIP: see if tests pass while figuring out target issue.
1 parent 4ac97e3 commit b87ed94

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ let package = Package(
2222
products: [
2323
.library(
2424
name: "DeepLearning",
25-
targets: ["DeepLearning", "third_party"]),
25+
targets: ["DeepLearning"/*, "third_party"*/]),
2626
],
2727
dependencies: [],
2828
targets: [
2929
.target(
3030
name: "DeepLearning",
3131
dependencies: []),
32-
.target(
33-
name: "third_party",
34-
dependencies: []),
32+
// .target(
33+
// name: "third_party",
34+
// dependencies: []),
3535
.testTarget(
3636
name: "DeepLearningTests",
3737
dependencies: ["DeepLearning"]),

Sources/third_party/Complex.swift renamed to Sources/DeepLearning/Complex.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// A major part of the Complex number implementation comes from
22
// [@xwu](https://github.com/xwu)'s project, [NumericAnnex](https://github.com/xwu/NumericAnnex).
33

4+
#if !COMPILING_TENSORFLOW_MODULE
5+
@_exported import TensorFlow
6+
#endif
7+
48
struct Complex<T : FloatingPoint> {
59
var real: T
610
var imaginary: T

Tests/DeepLearningTests/ComplexTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ final class ComplexTests: XCTestCase {
7171
XCTAssertEqual(complexA, complexB)
7272

7373
complexA = Complex(real: 5, imaginary: 0)
74-
expectNotEqual(complexA, complexB)
74+
XCTAssertNotEqual(complexA, complexB)
7575
}
7676

7777
func testPlus() {
@@ -192,7 +192,7 @@ final class ComplexTests: XCTestCase {
192192
XCTAssertEqual(pb(Complex(real: 1, imaginary: 1)), Complex<Float>(real: -1, imaginary: -1))
193193
}
194194

195-
func testVjpAdding() {
195+
func testVjpAddingReal() {
196196
let pb: (Complex<Float>) -> Complex<Float> = pullback(at: Complex<Float>(real: 20, imaginary: -4)) { x in
197197
return x.adding(real: 5)
198198
}
@@ -201,7 +201,7 @@ final class ComplexTests: XCTestCase {
201201
XCTAssertEqual(pb(Complex(real: 1, imaginary: 1)), Complex<Float>(real: 1, imaginary: 1))
202202
}
203203

204-
func testVjpAdding() {
204+
func testVjpAddingImaginary() {
205205
let pb: (Complex<Float>) -> Complex<Float> = pullback(at: Complex<Float>(real: 20, imaginary: -4)) { x in
206206
return x.adding(imaginary: 5)
207207
}
@@ -210,7 +210,7 @@ final class ComplexTests: XCTestCase {
210210
XCTAssertEqual(pb(Complex(real: 1, imaginary: 1)), Complex<Float>(real: 1, imaginary: 1))
211211
}
212212

213-
func testVjpSubtracting() {
213+
func testVjpSubtractingReal() {
214214
let pb: (Complex<Float>) -> Complex<Float> = pullback(at: Complex<Float>(real: 20, imaginary: -4)) { x in
215215
return x.subtracting(real: 5)
216216
}
@@ -219,7 +219,7 @@ final class ComplexTests: XCTestCase {
219219
XCTAssertEqual(pb(Complex(real: 1, imaginary: 1)), Complex<Float>(real: 1, imaginary: 1))
220220
}
221221

222-
func testVjpSubtracting() {
222+
func testVjpSubtractingImaginary() {
223223
let pb: (Complex<Float>) -> Complex<Float> = pullback(at: Complex<Float>(real: 20, imaginary: -4)) { x in
224224
return x.subtracting(imaginary: 5)
225225
}

0 commit comments

Comments
 (0)