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

Correct 'XCTAssertEqual(_:_:)' argument order. #155

Merged
merged 11 commits into from
Jun 1, 2019

Conversation

Shashi456
Copy link
Contributor

fix #153

@Shashi456
Copy link
Contributor Author

Please do tell me, If I have missed anything. I'll request a review once i'm done with all the files in the directory

@Shashi456
Copy link
Contributor Author

@rxwei @eaplatanios requesting a review. Most probably only cleanup needed,

@Shashi456 Shashi456 changed the title [WIP] changes in OperatorsTests/ changes in OperatorsTests/ May 31, 2019
@Shashi456
Copy link
Contributor Author

Also, I did skim the rest of the tests, there seem to be no errors in them.

@Shashi456
Copy link
Contributor Author

@rxwei There's just so many PRs xD. Can you trigger a build on this?

@Shashi456
Copy link
Contributor Author

Alright, all the builds seem to be failing because of the error on line 296. This should fix that.

@Shashi456
Copy link
Contributor Author

Shashi456 commented May 31, 2019

@rxwei so the error is that expected is not double, any way i could get it to conform to that?

Actually the tests passed before i changed that particular piece of code, should i just reverse it?

@rxwei
Copy link
Contributor

rxwei commented May 31, 2019

Apply the following change will fix the error.

-               let expected = Array(stride(from: 20.0, to: 30, by: 2)) +
-                              Array(stride(from: 45.0, to: 50, by: 1)) +
-                       Array(stride(from: 30.0, to: 40, by: 2)) +
-                       Array(stride(from: 55.0, to: 60, by: 1))
-
         /// Test shapes
         XCTAssertEqual(array3D.shape, [1, 4, 5])
         XCTAssertEqual(array2D.shape, [2, 5])
         XCTAssertEqual(array1D.shape, [2])

         /// Test scalars
-        XCTAssertEqual(array3D.scalars, expected)
+        XCTAssertEqual(array3D.scalars,
+                       [Float](stride(from: 20.0, to: 30, by: 2)) +
+                            Array(stride(from: 45.0, to: 50, by: 1)) +
+                       [Float](stride(from: 30.0, to: 40, by: 2)) +
+                       [Float](stride(from: 55.0, to: 60, by: 1)))
         XCTAssertEqual(array2D.scalars, Array(stride(from: 20.0, to: 30, by: 1)))
         XCTAssertEqual(array1D.scalars, Array(stride(from: 3.0, to: 5, by: 1)))
     }

@Shashi456
Copy link
Contributor Author

@rxwei @eaplatanios Can you help me debug this ?

[86/86] Testing TensorFlowTests.MathOperatorTests/testBroadcastedAddGradient

Test Suite 'Selected tests' started at 2019-05-31 14:27:03.685
Test Suite 'SequentialTests' started at 2019-05-31 14:27:04.877
Test Case 'SequentialTests.testSequential' started at 2019-05-31 14:27:04.877
Exited with signal code 11

Test Suite 'Selected tests' started at 2019-05-31 14:27:03.636
Test Suite 'TrivialModelTests' started at 2019-05-31 14:27:04.716
Test Case 'TrivialModelTests.testXOR' started at 2019-05-31 14:27:04.716
Exited with signal code 11

Test Suite 'Selected tests' started at 2019-05-31 14:27:17.778
Test Suite 'LayerTests' started at 2019-05-31 14:27:18.919
Test Case 'LayerTests.testRNN' started at 2019-05-31 14:27:18.919
Exited with signal code 11

Test Suite 'Selected tests' started at 2019-05-31 14:27:33.903
Test Suite 'DatasetTests' started at 2019-05-31 14:27:34.889
Test Case 'DatasetTests.testSingleValueTransformations' started at 2019-05-31 14:27:34.889
failed to demangle witness for associated type 'Iterator' in conformance 'TensorFlow.Dataset<TensorFlow.Tensor<Swift.Float>>: Sequence' from mangled name '10TensorFlow15DatasetIteratorVyxG'
Exited with signal code 6

Test Suite 'Selected tests' started at 2019-05-31 14:27:34.047
Test Suite 'DatasetTests' started at 2019-05-31 14:27:35.155
Test Case 'DatasetTests.testSingleValueHOFs' started at 2019-05-31 14:27:35.155
failed to demangle witness for associated type 'Iterator' in conformance 'TensorFlow.Dataset<TensorFlow.Tensor<Swift.Float>>: Sequence' from mangled name '10TensorFlow15DatasetIteratorVyxG'
Exited with signal code 6

Test Suite 'Selected tests' started at 2019-05-31 14:27:34.697
Test Suite 'DatasetTests' started at 2019-05-31 14:27:35.849
Test Case 'DatasetTests.testParallelMap' started at 2019-05-31 14:27:35.849
failed to demangle witness for associated type 'Iterator' in conformance 'TensorFlow.Dataset<TensorFlow.Tensor<Swift.Float>>: Sequence' from mangled name '10TensorFlow15DatasetIteratorVyxG'
Exited with signal code 6

Test Suite 'Selected tests' started at 2019-05-31 14:27:35.076
Test Suite 'DatasetTests' started at 2019-05-31 14:27:36.272
Test Case 'DatasetTests.testMapToDifferentType' started at 2019-05-31 14:27:36.272
failed to demangle witness for associated type 'Iterator' in conformance 'TensorFlow.Dataset<TensorFlow.Tensor<Swift.Float>>: Sequence' from mangled name '10TensorFlow15DatasetIteratorVyxG'
Exited with signal code 6

Test Suite 'Selected tests' started at 2019-05-31 14:27:36.426
Test Suite 'MathOperatorTests' started at 2019-05-31 14:27:37.526
Test Case 'MathOperatorTests.testExpm1' started at 2019-05-31 14:27:37.527
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("1.7182817") is not equal to ("1.0") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("6.389056") is not equal to ("2.7182817") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("19.085537") is not equal to ("7.389056") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("53.598152") is not equal to ("20.085537") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("147.41316") is not equal to ("54.598152") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("1.7182817") is not equal to ("1.0") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("6.389056") is not equal to ("2.7182817") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("19.085537") is not equal to ("7.389056") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("53.598152") is not equal to ("20.085537") +/- ("0.0001") -
/home/paws/swift-apis/Tests/TensorFlowTests/Helpers.swift:20: error: MathOperatorTests.testExpm1 : XCTAssertEqual failed: ("147.41316") is not equal to ("54.59815") +/- ("0.0001") -
Test Case 'MathOperatorTests.testExpm1' failed (0.136 seconds)
Test Suite 'MathOperatorTests' failed at 2019-05-31 14:27:37.662
         Executed 1 test, with 10 failures (0 unexpected) in 0.136 (0.136) seconds
Test Suite 'Selected tests' failed at 2019-05-31 14:27:37.663
         Executed 1 test, with 10 failures (0 unexpected) in 0.136 (0.136) seconds

@eaplatanios
Copy link
Contributor

This is a bug that appears in Linux and not Mac. You can track its progress in #161.

@Shashi456
Copy link
Contributor Author

Shashi456 commented May 31, 2019

and the math errors @eaplatanios, can you also check if the values are right or wrong?

NOTE : oh well, none of the errors seem to stem from the changes i made. all are from expm1.

@Shashi456
Copy link
Contributor Author

Shashi456 commented May 31, 2019

the dataset errors persist. I thought it would be because of the order. but the reason seems to be something else.

@rxwei if we sort these errors out, then we are good to go ahead with this PR.

@eaplatanios
Copy link
Contributor

@Shashi456 The numerical errors in the tests should be fixed in #147. I'm not sure why we get the other failures on Linux yet.

@Shashi456
Copy link
Contributor Author

@eaplatanios are you saying the dataset tests fail only on linux?

@eaplatanios
Copy link
Contributor

I believe so yes. At least they don't fail on my MacBook.

@Shashi456
Copy link
Contributor Author

@eaplatanios, that's very strange

@Shashi456
Copy link
Contributor Author

Shashi456 commented Jun 1, 2019

So @rxwei just a small question, Do you think this is a issue within the code? because @eaplatanios did mention that they are passing on mac OS. I'm inclined to believe it's an ubuntu issue,

Edit : I tested the code after these changes and it threw the same errors

@Shashi456
Copy link
Contributor Author

@rxwei could you trigger a build on this once? I want to see if #163 solved the issues.

@Shashi456
Copy link
Contributor Author

@rxwei this passes now, I think this can be merged. Thanks a lot, @bgogul for fixing the errors.

@rxwei rxwei changed the title changes in OperatorsTests/ Correct 'XCTAssertEqual(_:_:)' argument order. Jun 1, 2019
@rxwei rxwei merged commit 20d1b45 into tensorflow:master Jun 1, 2019
@rxwei
Copy link
Contributor

rxwei commented Jun 1, 2019

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correct 'XCTAssertEqual(_:_:)' argument order.
4 participants