Closed fritzo closed 3 years ago
@ordabayevy I hope this can serve as a template for your #482 . Feel free to refactor after this PR merges, in case you'd like to reuse the logic e.g. in find_domain
or eager.register
. We may even be able to create a subclass ReductionOp(UnaryOp)
, replace to use
- @UnaryOp.make
+ @ReductionOp.make
def sum(...):
...
and register ops.sum
, ops.mean
, etc. in a single pattern.
Addresses #489 pair coded with @eb8680 @ordabayevy @fehiepsi
This demonstrates the new parametrized op syntax from #491 . The recipe is:
*args, *kwargs
to your op infunsor.ops.array
funsor.torch.ops
andfunsor.jax.ops
find_domain(op, ...)
infunsor.domains
funsor.tensor
Tested