Skip to content
Draft
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion funsor/terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,12 @@ class SubsMeta(FunsorMeta):

def __call__(cls, arg, subs):
subs = tuple(
(k, to_funsor(v, arg.inputs[k])) for k, v in subs if k in arg.inputs
(k, to_funsor(v, arg.inputs[k]))
for k, v in subs
if k in arg.inputs and k is not v
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if v is already a Variable?

)
if not subs:
return arg
return super().__call__(arg, subs)


Expand Down