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

Commit 8bb9b1a

Browse files
authored
Update code example to use the context argument.
1 parent ec2dd47 commit 8bb9b1a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ struct Model: Layer {
2929
var layer3 = Dense<Float>(inputSize: hiddenSize, outputSize: 3, activation: identity)
3030

3131
@differentiable(wrt: (self, input))
32-
func applied(to input: Tensor<Float>) -> Tensor<Float> {
33-
let l1 = layer1.applied(to: input)
34-
let l2 = layer2.applied(to: l1)
35-
return layer3.applied(to: l2)
32+
func applied(to input: Tensor<Float>, in context: Context) -> Tensor<Float> {
33+
let l1 = layer1.applied(to: input, in: context)
34+
let l2 = layer2.applied(to: l1, in: context)
35+
return layer3.applied(to: l2, in: context)
3636
}
3737
}
3838
```

0 commit comments

Comments
 (0)