Skip to content

Commit 2892db5

Browse files
authored
Fix MyDense example input to use tf.Variable instead of list
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.
1 parent e21d085 commit 2892db5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/en/guide/intro_to_modules.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@
775775
},
776776
"outputs": [],
777777
"source": [
778-
"simple_layer([[2.0, 2.0, 2.0]])"
778+
"simple_layer(tf.Variable([[2.0, 2.0, 2.0]]))"
779779
]
780780
},
781781
{

0 commit comments

Comments
 (0)