Skip to content

Created using Colab#1103

Open
GaryHalo wants to merge 1 commit into
tensorflow:masterfrom
GaryHalo:master
Open

Created using Colab#1103
GaryHalo wants to merge 1 commit into
tensorflow:masterfrom
GaryHalo:master

Conversation

@GaryHalo

@GaryHalo GaryHalo commented Jul 5, 2026

Copy link
Copy Markdown

No description provided.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]))"
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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]]))"

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