Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use static shape in join_nonshared_inputs #7613

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pymc/pytensorf.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,13 @@ def join_nonshared_inputs(
raise ValueError("Empty list of input variables.")

raveled_inputs = pt.concatenate([var.ravel() for var in inputs])
size = sum(point[var_name].size for var_name in point)

if not make_inputs_shared:
tensor_type = raveled_inputs.type
joined_inputs = tensor_type("joined_inputs")
joined_inputs = pt.tensor("joined_inputs", shape=(size,), dtype=raveled_inputs.dtype)
else:
joined_values = np.concatenate([point[var.name].ravel() for var in inputs])
joined_inputs = pytensor.shared(joined_values, "joined_inputs")
joined_inputs = pytensor.shared(joined_values, "joined_inputs", shape=(size,))

if pytensor.config.compute_test_value != "off":
joined_inputs.tag.test_value = raveled_inputs.tag.test_value
Expand Down
Loading