From 2892db5b4b7e8feb56b5a8df664a7edd15cad215 Mon Sep 17 00:00:00 2001 From: vishnoi246 Date: Tue, 7 Oct 2025 00:32:31 +0530 Subject: [PATCH] Fix MyDense example input to use tf.Variable instead of list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- site/en/guide/intro_to_modules.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/en/guide/intro_to_modules.ipynb b/site/en/guide/intro_to_modules.ipynb index 79bbe89ca56..5ea08639f37 100644 --- a/site/en/guide/intro_to_modules.ipynb +++ b/site/en/guide/intro_to_modules.ipynb @@ -775,7 +775,7 @@ }, "outputs": [], "source": [ - "simple_layer([[2.0, 2.0, 2.0]])" + "simple_layer(tf.Variable([[2.0, 2.0, 2.0]]))" ] }, {