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,
      build_info,
      dtype,
      use_placeholder,
      ensure_self_adjoint_and_pd=False,
  ):
      shape = list(build_info.shape)
      perm = math_ops.range(0, shape[-1])
      perm = array_ops.broadcast_to(perm, shape[:-1])
      perm = random_ops.random_shuffle(perm)
  
      if use_placeholder:
          perm = array_ops.placeholder_with_default(perm, shape=None)
  
      operator = permutation.LinearOperatorPermutation(
          perm, dtype=dtype
      )
      matrix = math_ops.cast(
          math_ops.equal(
              math_ops.range(0, shape[-1]), perm[..., array_ops.newaxis]
          ),
          dtype,
      )
      return operator, matrix
  
imports: from tensorflow.python.framework import constant_op
  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 linalg_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.linalg import linalg
  from tensorflow.python.ops.linalg import linear_operator_permutation
  from tensorflow.python.ops.linalg import linear_operator_test_util
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the LinearOperatorPermutationTest obj's underlying member method code with example usage: obj.operator_and_matrix(build_info, dtype, use_placeholder, ensure__adjoint_and_pd) and returns: operator,  matrix