Avatar
import TensorFlow var x: Tensor<Float> = [1.0] print(gradient(of: { sigmoid($0) })(x[0])) // 0.0 -> wrong? print(gradient(of: sigmoid)(sigmoid(x[0]))) // 0.19... -> correct? print(gradient(of: sqrt)(x[0])) // 0.5 -> correct