Created using Colab#1103
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Code Review
This pull request updates the hello_many_worlds.ipynb tutorial to use newer versions of TensorFlow and TensorFlow Quantum, and configures the environment to use legacy Keras 2. A critical issue was identified in the notebook where controller.predict is called with a 1D array np.array([0, 1]), which will raise a ValueError because the model expects a 2D input of shape (batch_size, 1). This should be corrected to np.array([[0], [1]]).
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| "outputs": [], | ||
| "source": [ | ||
| "controller.predict(np.array([0, 1]))" | ||
| ] |
There was a problem hiding this comment.
The controller model expects a 2D input of shape (batch_size, 1) because it was built with commands_input having shape (None, 1). Passing a 1D array of shape (2,) via np.array([0, 1]) to controller.predict will raise a ValueError due to incompatible input dimensions. To fix this, pass a 2D array of shape (2, 1) instead.
"controller.predict(np.array([[0], [1]]))"
No description provided.