-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Currently ops.run() returns an Object i.e. it returns an OpRunner<Object>. This is normally fine for single-stage transformations. Take for example ops.run("foo.bar", new UnsignedByteType(), new DoubleType(). This call to ops.run can match a BiFunction, Computer, or BiInplace without problems. Let's say, however, that you have a BiComputer that you would like to match through BiComputer -> BiFunction -> OpRunner, as was done often in the old framework (normally accomplished through hybrids, which we no longer have). The matcher will then, after attempting to look for a suitable BiFunction<UnsignedByteType, DoubleType, Object> transform this BiFunction into a BiComputer<UnsignedByteType, DoubleType, Object>. This signature will (by design) never match any Op in ops because this signature guarantees that the matched op can take any Object as input (which no Ops do in practice). This makes this type of transformation impossible without some changes.
Solution: Allow ops.run to match using an OpRunner<Any> instead of an OpRunner<Object>? This can, however, pose problems during the transformation phase, since the above BiComputer -> BiFunction transformation needs to create an output to pass to the computer. As such, this transformation will need to know more information than is contained within the passed OpRef (which in the above example would be BiFunction<UnsignedByteType, DoubleType, Any>). This could either be done by passing the OpInfo/OpCandidate to the transformers or through doing some Any resolution using the matched BiComputer before passing the above OpRef to the transformer.
TODO:
- Are there more scenarios in which the
OpRunner<Object>fails during transformation?