Lines Matching refs:op1

128         op1 = ops_to_try_at_this_tier.pop()
129 op2, adder = _pop_a_match_at_tier(op1, ops_to_try_at_this_tier, tier)
132 new_operator = adder.add(op1, op2, operator_name)
135 ops_to_try_at_next_tier.append(op1)
140 def _pop_a_match_at_tier(op1, operator_list, tier):
146 if adder.can_add(op1, op2):
151 def _infer_hints_allowing_override(op1, op2, hints):
152 """Infer hints from op1 and op2. hints argument is an override.
155 op1: LinearOperator
159 If some hint is None, try to set using op1 and op2. If the
160 hint is provided, ignore op1 and op2 hints. This allows an override
170 is_self_adjoint = op1.is_self_adjoint and op2.is_self_adjoint
176 is_positive_definite = op1.is_positive_definite and op2.is_positive_definite
251 def can_add(self, op1, op2):
252 """Returns `True` if this `Adder` can add `op1` and `op2`. Else `False`."""
256 def _add(self, op1, op2, operator_name, hints):
257 # Derived classes can assume op1 and op2 have been validated, e.g. they have
261 def add(self, op1, op2, operator_name, hints=None):
262 """Return new `LinearOperator` acting like `op1 + op2`.
265 op1: `LinearOperator`
267 `op1` is allowed.
275 updated_hints = _infer_hints_allowing_override(op1, op2, hints)
278 operator_name = "Add/" + op1.name + "__" + op2.name + "/"
280 values = op1.graph_parents + op2.graph_parents
285 return self._add(op1, op2, operator_name, updated_hints)
295 def can_add(self, op1, op2):
296 types = {_type(op1), _type(op2)}
299 def _add(self, op1, op2, operator_name, hints):
302 if _type(op1) == _SCALED_IDENTITY:
303 multiplier_1 = op1.multiplier
305 multiplier_1 = array_ops.ones(op1.batch_shape_tensor(), dtype=op1.dtype)
313 num_rows=op1.range_dimension_tensor(),
324 def can_add(self, op1, op2):
325 types = {_type(op1), _type(op2)}
328 def _add(self, op1, op2, operator_name, hints):
330 diag=op1.diag_part() + op2.diag_part(),
340 def can_add(self, op1, op2):
341 types = {_type(op1), _type(op2)}
344 def _add(self, op1, op2, operator_name, hints):
345 if _type(op1) in _EFFICIENT_ADD_TO_TENSOR:
346 op_add_to_tensor, op_other = op1, op2
348 op_add_to_tensor, op_other = op2, op1
361 def can_add(self, op1, op2): # pylint: disable=unused-argument
362 return isinstance(op1, linear_operator.LinearOperator) and isinstance(
365 def _add(self, op1, op2, operator_name, hints):
366 if _type(op1) in _EFFICIENT_ADD_TO_TENSOR:
367 op_add_to_tensor, op_other = op1, op2
369 op_add_to_tensor, op_other = op2, op1