Skip to content

Conversation

vishnoi246
Copy link

This PR fixes a small issue in the MyDense layer example in intro_to_modules.ipynb. The original code used a plain Python list as input: simple_layer([[2.0, 2.0, 2.0]])

This caused an error because tf.matmul expects a TensorFlow tensor or variable, not a list.

Updated the code to:
simple_layer(tf.Variable([[2.0, 2.0, 2.0]]))

This change ensures the example runs correctly and aligns with TensorFlow’s expected input types.

This PR fixes a small issue in the MyDense layer example in intro_to_modules.ipynb.
The original code used a plain Python list as input:
simple_layer([[2.0, 2.0, 2.0]])

This caused an error because tf.matmul expects a TensorFlow tensor or variable, not a list.

Updated the code to:
simple_layer(tf.Variable([[2.0, 2.0, 2.0]]))

This change ensures the example runs correctly and aligns with TensorFlow’s expected input types.
@vishnoi246 vishnoi246 requested a review from a team as a code owner October 6, 2025 19:02
Copy link

github-actions bot commented Oct 6, 2025

Preview

Preview and run these notebook edits with Google Colab: Rendered notebook diffs available on ReviewNB.com.

Format and style

Use the TensorFlow docs notebook tools to format for consistent source diffs and lint for style:
$ python3 -m pip install -U --user git+https://github.com/tensorflow/docs

$ python3 -m tensorflow_docs.tools.nbfmt notebook.ipynb
$ python3 -m tensorflow_docs.tools.nblint --arg=repo:tensorflow/docs notebook.ipynb
If commits are added to the pull request, synchronize your local branch: git pull origin patch-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant