Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Fix broadcastables inference for Alloc and an as_tensor_variable bug when all ndim=0 and all dimensions are broadcastable#694

Merged
brandonwillard merged 2 commits intoaesara-devs:mainfrom
brandonwillard:fix-alloc-broadcastable-inference
Dec 9, 2021
Merged

Fix broadcastables inference for Alloc and an as_tensor_variable bug when all ndim=0 and all dimensions are broadcastable#694
brandonwillard merged 2 commits intoaesara-devs:mainfrom
brandonwillard:fix-alloc-broadcastable-inference

Conversation

@brandonwillard
Copy link
Copy Markdown
Member

@brandonwillard brandonwillard commented Dec 9, 2021

This PR closes #692.

It generalizes the broadcastables inference used by RandomVariable, which performs constant folding and shape simplification rewrites instead of using get_scalar_constant_value.

@brandonwillard brandonwillard added the bug Something isn't working label Dec 9, 2021
@brandonwillard brandonwillard self-assigned this Dec 9, 2021
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 9, 2021

Codecov Report

Merging #694 (c67e71b) into main (4e10772) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #694      +/-   ##
==========================================
+ Coverage   77.59%   77.61%   +0.02%     
==========================================
  Files         152      152              
  Lines       46926    46915      -11     
  Branches    10885    10883       -2     
==========================================
+ Hits        36412    36413       +1     
+ Misses       7904     7895       -9     
+ Partials     2610     2607       -3     
Impacted Files Coverage Δ
aesara/tensor/basic.py 86.17% <100.00%> (+0.58%) ⬆️
aesara/tensor/extra_ops.py 88.46% <100.00%> (ø)
aesara/tensor/random/op.py 98.57% <100.00%> (-0.07%) ⬇️
aesara/tensor/basic_opt.py 83.91% <0.00%> (+0.12%) ⬆️

@brandonwillard brandonwillard merged commit 34375f4 into aesara-devs:main Dec 9, 2021
@brandonwillard brandonwillard deleted the fix-alloc-broadcastable-inference branch December 9, 2021 22:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong broadcastable output of Alloc when using SpecifyShape

1 participant