Skip to content

Commit

Permalink
Add reminder TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo committed Apr 19, 2022
1 parent 72094d1 commit a865f2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aesara/tensor/basic_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,7 @@ def local_upcast_elemwise_constant_inputs(fgraph, node):
@local_optimizer([SpecifyShape])
def local_useless_specify_shape(fgraph, node):
"""Remove `SpecifyShape` if it does not actually change the shape pattern."""
# TODO: Check, this may be a repeated rewrite
if isinstance(node.op, SpecifyShape):
x = node.inputs[0]
if np.all(x.type.shape == node.outputs[0].type.shape):
Expand All @@ -2278,6 +2279,7 @@ def local_specify_shape_lift(fgraph, node):
SpecifyShape(SpecifyShape(x)) => SpecifyShape(x)
"""
# TODO: Check, this may be a repeated rewrite
op = node.op
if not isinstance(op, SpecifyShape):
return False
Expand Down Expand Up @@ -2341,7 +2343,7 @@ def apply_specify_shape_opt(rval):
A Variable (the same if no optimization can be applied)
"""

# TODO: Assess if this still makes sense...
fg = FunctionGraph([], [])
changed = True
while changed and rval.owner:
Expand Down

0 comments on commit a865f2d

Please sign in to comment.