Skip to content

Update infer_shape signatures #4248

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

Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pymc3/distributions/multivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def perform(self, node, inputs, outputs):
pm._log.exception("Failed to check if %s positive definite", x)
raise

def infer_shape(self, node, shapes):
def infer_shape(self, fgraph, node, shapes):
return [[]]

def grad(self, inp, grads):
Expand Down
4 changes: 2 additions & 2 deletions pymc3/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def grad(self, inputs, gout):
idx = tt.arange(gz.shape[-1])
return [gz[..., idx, idx]]

def infer_shape(self, nodes, shapes):
def infer_shape(self, fgraph, nodes, shapes):
return [(shapes[0][0],) + (shapes[0][1],) * 2]


Expand Down Expand Up @@ -418,7 +418,7 @@ def grad(self, inputs, gout):
]
return [gout[0][slc] for slc in slices]

def infer_shape(self, nodes, shapes):
def infer_shape(self, fgraph, nodes, shapes):
first, second = zip(*shapes)
return [(tt.add(*first), tt.add(*second))]

Expand Down
2 changes: 1 addition & 1 deletion pymc3/ode/ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def perform(self, node, inputs_storage, output_storage):
# simulate states and sensitivities in one forward pass
output_storage[0][0], output_storage[1][0] = self._simulate(y0, theta)

def infer_shape(self, node, input_shapes):
def infer_shape(self, fgraph, node, input_shapes):
s_y0, s_theta = input_shapes
output_shapes = [(self.n_times, self.n_states), (self.n_times, self.n_states, self.n_p)]
return output_shapes
Expand Down