class_docstr: Test that the order of addition is done as specified by tiers.
class_docstr_tok: ["Test","that","the","order","of","addition","is","done","as","specified","by","tiers","."]
code: def test_cannot_add_everything_so_return_more_than_one_operator(self):
      diag1 = linalg.LinearOperatorDiag([1.0])
      diag2 = linalg.LinearOperatorDiag([2.0])
      tril5 = linalg.LinearOperatorLowerTriangular([[5.0]])
      addition_tiers = [
          [linear_operator_addition._AddAndReturnDiag()],
      ]
      # Tier 0 (the only tier) can only convert to Diag, so it combines the two
      # diags, but the TriL is unchanged.
      # Result should contain two operators, one Diag, one TriL.
      op_sum = add_operators(
          [diag1, diag2, tril5], addition_tiers=addition_tiers
      )
      self.assertEqual(2, len(op_sum))
      found_diag = False
      found_tril = False
      with self.cached_session():
          for op in op_sum:
              if isinstance(op, linalg.LinearOperatorDiag):
                  found_diag = True
                  self.assertAllClose([[3.0]], op.to_dense())
              if isinstance(op, linalg.LinearOperatorLowerTriangular):
                  found_tril = True
                  self.assertAllClose([[5.0]], op.to_dense())
          self.assertTrue(found_diag and found_tril)
  
imports: import numpy
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import linalg_ops
  from tensorflow.python.ops.linalg import linalg
  from tensorflow.python.ops.linalg import linear_operator_addition
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the LinearOperatorOrderOfAdditionTest obj's underlying member method code with example usage: obj.test_cannot_add_everything_so_return_more_than_one_operator() without return types