Better assertion message in vectorizing_map.
One situation that triggers this assertion is when trying to tf.print(pfor_config.collect(something)). Arguably that should just work, but failing that, having the error indicate the nature of the problem is helpful. PiperOrigin-RevId: 249108396
This commit is contained in:
parent
12f2364774
commit
17e070371e
@ -993,7 +993,8 @@ class PForConfig(object):
|
||||
|
||||
def _lookup_reduction(self, pl):
|
||||
"""Lookups Placeholder `pl` in the reduction map."""
|
||||
assert isinstance(pl, ops.Tensor)
|
||||
msg = "Expected Tensor, got {} of type {}."
|
||||
assert isinstance(pl, ops.Tensor), msg.format(pl, type(pl))
|
||||
return self._reduce_concat_map.get(pl, None)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user