Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 5105486

Browse files
jekbradburyrxwei
authored andcommitted
Remove deprecated comments +@noDerivative (#135)
Comments no longer apply (AD bug has been fixed and arrays now conform to `Differentiable`)
1 parent a7e4c7a commit 5105486

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

MiniGo/Models/GoModel.swift

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -111,30 +111,10 @@ public struct GoModelOutput: Differentiable {
111111
public let logits: Tensor<Float>
112112
}
113113

114-
// This might be needed when we add training to work around an AD bug for memberwise initializers
115-
// @differentiable(wrt: (policy, value, logits), vjp: _vjpMakeGoModelOutput)
116-
// func makeGoModelOutput(
117-
// policy: Tensor<Float>, value: Tensor<Float>, logits: Tensor<Float>)
118-
// -> GoModelOutput {
119-
// return GoModelOutput(policy: policy, value: value, logits: logits)
120-
// }
121-
// func _vjpMakeGoModelOutput(
122-
// policy: Tensor<Float>, value: Tensor<Float>, logits: Tensor<Float>)
123-
// -> (GoModelOutput, (GoModelOutput.CotangentVector)
124-
// -> (Tensor<Float>, Tensor<Float>, Tensor<Float>)) {
125-
// let result = GoModelOutput(policy: policy, value: value, logits: logits)
126-
// return (result, { seed in (seed.policy, seed.value, seed.logits) })
127-
// }
128-
129114
public struct GoModel: Layer {
130115
@noDerivative let configuration: ModelConfiguration
131116
var initialConv: ConvBN
132-
// TODO(jekbradbury): support differentiation wrt residualBlocks
133-
// [T] where T: Differentiable doesn't (shouldn't?) conform to Differentiable,
134-
// so we will likely need a LayerArray<T> where T: Layer type. But this
135-
// itself won't work until we have better generics support, and even then
136-
// T can't be an existential Layer. So it's @noDerivative for now.
137-
@noDerivative var residualBlocks: [ResidualIdentityBlock]
117+
var residualBlocks: [ResidualIdentityBlock]
138118
var policyConv: ConvBN
139119
var policyDense: Dense<Float>
140120
var valueConv: ConvBN

0 commit comments

Comments
 (0)