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

Method add

tensorflow/python/ops/linalg/linear_operator_addition.py:266–290  ·  view source on GitHub ↗

Return new `LinearOperator` acting like `op1 + op2`. Args: op1: `LinearOperator` op2: `LinearOperator`, with `shape` and `dtype` such that adding to `op1` is allowed. operator_name: `String` name to give to returned `LinearOperator` hints: `_Hints` object. R

(self, op1, op2, operator_name, hints=None)

Source from the content-addressed store, hash-verified

264 pass
265
266 def add(self, op1, op2, operator_name, hints=None):
267 """Return new `LinearOperator` acting like `op1 + op2`.
268
269 Args:
270 op1: `LinearOperator`
271 op2: `LinearOperator`, with `shape` and `dtype` such that adding to
272 `op1` is allowed.
273 operator_name: `String` name to give to returned `LinearOperator`
274 hints: `_Hints` object. Returned `LinearOperator` will be created with
275 these hints.
276
277 Returns:
278 `LinearOperator`
279 """
280 updated_hints = _infer_hints_allowing_override(op1, op2, hints)
281
282 if operator_name is None:
283 operator_name = "Add/" + op1.name + "__" + op2.name + "/"
284
285 values = op1.graph_parents + op2.graph_parents
286 scope_name = self.name
287 if scope_name.startswith("_"):
288 scope_name = scope_name[1:]
289 with ops.name_scope(scope_name, values=values):
290 return self._add(op1, op2, operator_name, updated_hints)
291
292
293class _AddAndReturnScaledIdentity(_Adder):

Callers 15

_AtanGradFunction · 0.45
loop_bodyMethod · 0.45
AddWhileContextMethod · 0.45
setUpMethod · 0.45
test_make_list_of_tMethod · 0.45
_ConcatGradHelperFunction · 0.45
normalMethod · 0.45
truncated_normalMethod · 0.45
uniformMethod · 0.45

Calls 3

_addMethod · 0.95
name_scopeMethod · 0.45

Tested by 15

loop_bodyMethod · 0.36
setUpMethod · 0.36
test_make_list_of_tMethod · 0.36
testAddSimpleMethod · 0.36
testAddSimpleGPUMethod · 0.36
testAddCustomizedMethod · 0.36
testSumTensorMethod · 0.36
testSumTensorMethod · 0.36