Context: callback cache should take into account input types as well as output types. The following simple example illustrates when a callback would have different mismatching inputs yet always returns the same type.
@pure_callback
def always_return_float(x) -> float:
if x == 0.0:
return x
else:
return x + 0.0
Description of the Change: Adds input types as part of the cache key
Context: callback cache should take into account input types as well as output types. The following simple example illustrates when a callback would have different mismatching inputs yet always returns the same type.
Description of the Change: Adds input types as part of the cache key
Benefits: No error.
Possible Drawbacks:
Related GitHub Issues: Fixes #851