diff options
author | 2018-07-10 16:47:06 -0700 | |
---|---|---|
committer | 2018-07-10 19:17:13 -0700 | |
commit | cdf896dcb7cd2b37016893a49861afc073973021 (patch) | |
tree | e0545f4f01ee05e88afa22ad143fb146b4d50400 /tensorflow/docs_src | |
parent | 603397dd0d2662a07cb15fe229b8e1c0ba51a483 (diff) |
[docs]: Be consistent about overriding model.call() (vs. model.predict()).
Fixes #20630
PiperOrigin-RevId: 204036333
Diffstat (limited to 'tensorflow/docs_src')
-rw-r--r-- | tensorflow/docs_src/guide/eager.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/docs_src/guide/eager.md b/tensorflow/docs_src/guide/eager.md index 003ca265fe..e98206eef9 100644 --- a/tensorflow/docs_src/guide/eager.md +++ b/tensorflow/docs_src/guide/eager.md @@ -421,7 +421,7 @@ class Model(tf.keras.Model): super(Model, self).__init__() self.W = tfe.Variable(5., name='weight') self.B = tfe.Variable(10., name='bias') - def predict(self, inputs): + def call(self, inputs): return inputs * self.W + self.B # A toy dataset of points around 3 * x + 2 @@ -432,7 +432,7 @@ training_outputs = training_inputs * 3 + 2 + noise # The loss function to be optimized def loss(model, inputs, targets): - error = model.predict(inputs) - targets + error = model(inputs) - targets return tf.reduce_mean(tf.square(error)) def grad(model, inputs, targets): |