Skip to content

Remove reshape_t #6118

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

Merged
merged 2 commits into from
Sep 11, 2022
Merged
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
10 changes: 1 addition & 9 deletions pymc/aesaraf.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def join_nonshared_inputs(
for var in vars:
shape = point[var.name].shape
arr_len = np.prod(shape, dtype=int)
replace[var] = reshape_t(inarray[last_idx : last_idx + arr_len], shape).astype(var.dtype)
replace[var] = inarray[last_idx : last_idx + arr_len].reshape(shape).astype(var.dtype)
last_idx += arr_len

replace.update(shared)
Expand All @@ -581,14 +581,6 @@ def join_nonshared_inputs(
return xs_special, inarray


def reshape_t(x, shape):
"""Work around fact that x.reshape(()) doesn't work"""
if shape != ():
return x.reshape(shape)
else:
return x[0]


class PointFunc:
"""Wraps so a function so it takes a dict of arguments instead of arguments."""

Expand Down