Skip to content

Commit 5d63e24

Browse files
authored
---
yaml --- r: 294855 b: refs/heads/tensorflow c: 21a0eee h: refs/heads/master i: 294853: 6712d27 294851: f53ebc4 294847: 52d6c7e
1 parent 5852d3a commit 5d63e24

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: f537a9205d833236b7dd2a5c146c20a0c9bd437d
819+
refs/heads/tensorflow: 21a0eee438e5117b014f225bc3b31967d10e3f2e
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/lib/SILOptimizer/Mandatory/Differentiation.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4541,8 +4541,11 @@ class AdjointEmitter final : public SILInstructionVisitor<AdjointEmitter> {
45414541
break;
45424542
}
45434543
case AdjointValueKind::Aggregate: {
4544-
llvm_unreachable("Unhandled. Are you trying to differentiate a "
4545-
"memberwise initializer?");
4544+
// Note: All user-called initializations go through the calls to the
4545+
// initializer, and synthesized initializers only have one level of struct
4546+
// formation which will not result into any aggregate adjoint valeus.
4547+
llvm_unreachable("Aggregate adjoint values should not occur for `struct` "
4548+
"instructions");
45464549
}
45474550
}
45484551
}

branches/tensorflow/test/AutoDiff/simple_math.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ SimpleMathTests.test("StructMemberwiseInitializer") {
184184

185185
let 𝛁foo = pullback(at: Float(4), in: { input -> Foo in
186186
let foo = Foo(stored: input)
187-
return foo + foo
187+
let foo2 = foo + foo
188+
return Foo(stored: foo2.stored)
188189
})(Foo.TangentVector(stored: 1))
189190
expectEqual(2, 𝛁foo)
190191

0 commit comments

Comments
 (0)