Skip to content

Defdata does not produce terms of the correct type in some cases #243

@jfeser

Description

@jfeser
x = defop(torch.Tensor)
w = defop(float)
print(repr(x() * w()))
print(repr(w() * x()))

produces

_TensorTerm(_BaseOperation(<function _wrap_binop.<locals>._wrapped_op at 0x10658fd00>, name=mul, freshening=[]), (_TensorTerm(_BaseOperation(<function _.<locals>.func at 0x12a9dd7e0>, name=Tensor, freshening=[1515040756]), (), {}), _RealTerm(_BaseOperation(<function _.<locals>.func at 0x12a9dcf70>, name=float, freshening=[3341589068]), (), {})), {})
_RealTerm(_BaseOperation(<function _wrap_binop.<locals>._wrapped_op at 0x10658fd00>, name=mul, freshening=[]), (_RealTerm(_BaseOperation(<function _.<locals>.func at 0x12a9dcf70>, name=float, freshening=[3341589068]), (), {}), _TensorTerm(_BaseOperation(<function _.<locals>.func at 0x12a9dd7e0>, name=Tensor, freshening=[1515040756]), (), {})), {})

but both should be TensorTerms.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions