class_docstr: Most tests done in the base class LinearOperatorDerivedClassTest.
class_docstr_tok: ["Most","tests","done","in","the","base","class","LinearOperatorDerivedClassTest","."]
code: def operator_and_matrix(
      self,
      shape_info,
      dtype,
      use_placeholder,
      ensure_self_adjoint_and_pd=False,
  ):
      del ensure_self_adjoint_and_pd
      shape = list(shape_info.shape)
      expected_blocks = (
          shape_info.__dict__["blocks"]
          if "blocks" in shape_info.__dict__
          else [shape]
      )
      matrices = [
          linear_operator_test_util.random_normal(
              block_shape, dtype=dtype
          )
          for block_shape in expected_blocks
      ]
  
      lin_op_matrices = matrices
  
      if use_placeholder:
          lin_op_matrices = [
              array_ops.placeholder_with_default(matrix, shape=None)
              for matrix in matrices
          ]
  
      blocks = []
      for l in lin_op_matrices:
          blocks.append(
              linalg.LinearOperatorFullMatrix(
                  l,
                  is_square=False,
                  is_self_adjoint=False,
                  is_positive_definite=False,
              )
          )
      operator = block_diag.LinearOperatorBlockDiag(blocks)
  
      # Broadcast the shapes.
      expected_shape = list(shape_info.shape)
  
      matrices = linear_operator_util.broadcast_matrix_batch_dims(
          matrices
      )
  
      block_diag_dense = _block_diag_dense(expected_shape, matrices)
  
      if not use_placeholder:
          block_diag_dense.set_shape(expected_shape)
  
      return operator, block_diag_dense
  
imports: import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops.linalg import linalg
  from tensorflow.python.ops.linalg import linear_operator_block_diag
  from tensorflow.python.ops.linalg import linear_operator_lower_triangular
  from tensorflow.python.ops.linalg import linear_operator_test_util
  from tensorflow.python.ops.linalg import linear_operator_util
  from tensorflow.python.platform import test
label_desc: Use image node_id 6 for calling the NonSquareLinearOperatorBlockDiagTest obj's underlying member method code with example usage: obj.operator_and_matrix(shape_info, dtype, use_placeholder, ensure__adjoint_and_pd) and returns: operator,  block_diag_dense