This repository was archived by the owner on Jul 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public extension Layer {
46
46
/// - Returns: The inference output.
47
47
@differentiable
48
48
func inferring( from input: Input ) -> Output {
49
- return withLearningPhase ( . inference) {
49
+ return withLearningPhase ( LearningPhase . inference) {
50
50
applied ( to: input)
51
51
}
52
52
}
@@ -57,7 +57,7 @@ public extension Layer {
57
57
internal func _vjpInferring( from input: Input )
58
58
-> ( value: Output , pullback: ( Output . CotangentVector )
59
59
-> ( CotangentVector , Input . CotangentVector ) ) {
60
- return withLearningPhase ( . inference) {
60
+ return withLearningPhase ( LearningPhase . inference) {
61
61
let ( output, pullback) = appliedForBackpropagation ( to: input)
62
62
return ( output, { v in pullback ( v) } )
63
63
}
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ final class ContextTests: XCTestCase {
22
22
let dropout = Dropout < Float > ( probability: 0.5 )
23
23
let x = Tensor < Float > ( repeating: 1.0 , shape: [ 5 , 5 ] )
24
24
XCTAssertEqual ( dropout. applied ( to: x) , x)
25
- withLearningPhase ( . inference) {
25
+ withLearningPhase ( LearningPhase . inference) {
26
26
XCTAssertEqual ( dropout. applied ( to: x) , x)
27
- withLearningPhase ( . training) {
27
+ withLearningPhase ( LearningPhase . training) {
28
28
XCTAssertNotEqual ( dropout. applied ( to: x) , x)
29
29
}
30
30
XCTAssertEqual ( dropout. applied ( to: x) , x)
@@ -39,7 +39,7 @@ final class ContextTests: XCTestCase {
39
39
DispatchQueue . concurrentPerform ( iterations: 10 ) { i in
40
40
if i. isMultiple ( of: 2 ) {
41
41
XCTAssertEqual ( dropout. applied ( to: x) , x)
42
- withLearningPhase ( . training) {
42
+ withLearningPhase ( LearningPhase . training) {
43
43
XCTAssertNotEqual ( dropout. applied ( to: x) , x)
44
44
}
45
45
XCTAssertEqual ( dropout. applied ( to: x) , x)
You can’t perform that action at this time.
0 commit comments