Skip to content

Commit 9c71e98

Browse files
Alfie-Edwardsgeorgepaw
authored andcommitted
Fix formatting of model subclass pipelining examples
Summary: One of the code examples was not showing and the other was showing the whole file rather than just the relevant part. TF2.5 Only Reviewers: #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, jamiep, #tensorflow, georgep Reviewed By: #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, jamiep, #tensorflow, georgep Maniphest Tasks: T58378 Differential Revision: https://phabricator.sourcevertex.net/D63199
1 parent 11a853b commit 9c71e98

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tensorflow/compiler/plugin/poplar/docs/keras_tf2.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ different pipeline stages as follows:
210210
.. literalinclude:: keras_tf2_example11.py
211211
:language: python
212212
:linenos:
213-
:start-at: input_layer = tf.keras.layers.Input((28, 28))
214-
:end-at: model = tf.keras.Model(inputs=input_layer, outputs=x)
213+
:start-at: class MyModel(tf.keras.Model):
214+
:end-at: return x
215215

216216
.. note::
217217
Layers *constructed* within an `ipu.keras.PipelineStage` context will have that
@@ -253,7 +253,8 @@ to four different pipeline stages as follows:
253253
.. literalinclude:: keras_tf2_example12.py
254254
:language: python
255255
:linenos:
256-
:start-at: strategy = ipu.ipu_strategy.IPUStrategy()
256+
:start-at: model = ExistingModel()
257+
:end-at: model.set_pipeline_stage_assignment(assignments)
257258

258259
.. note::
259260

0 commit comments

Comments
 (0)