MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / custom_add

Method custom_add

tensorflow/python/util/dispatch_test.py:56–58  ·  view source on GitHub ↗
(x, y, name=None)

Source from the content-addressed store, hash-verified

54 # Override the behavior of gen_math_ops.add.
55 @dispatch.dispatch_for_types(gen_math_ops.add, CustomTensor)
56 def custom_add(x, y, name=None): # pylint: disable=unused-variable
57 return CustomTensor(gen_math_ops.add(x.tensor, y.tensor, name),
58 (x.score+y.score) / 2.0)
59 self.assertEqual(len(math_ops.add._tf_dispatchers),
60 len(original_handlers) + 1)
61

Callers

nothing calls this directly

Calls 2

CustomTensorClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected