Skip to content

Wrong broadcasting of size 1 vector distributions defined with dims #5613

Closed
@ricardoV94

Description

@ricardoV94

And this particular situation of not broadcasting two 1d arrays of lenghts 1 and 10 feels strange, how does broadcasting differ between Aesara and numpy?

Somehow the dims is turning the output variable into something that is not (known) to be broadcastable:

import pymc as pm

with pm.Model(coords={"slopes":["x_1"]}) as m:

    b_dim = pm.Normal("b_dim", sigma=1000, dims=("slopes"))
    b_size = pm.Normal("b_size", sigma=1000, size=1)

print(b_dim.broadcastable, b_size.broadcastable)
# (False,) (True,)

Originally posted by @ricardoV94 in #5561 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions