class_docstr: Tests for the functionality of the Python wrappers.
docstr: Tests for the output layer initializer in the linear multi-class case.
docstr_tok: ["Tests","for","the","output","layer","initializer","in","the","linear","multi-class","case","."]
code: def test_load_and_remap_output_layer_weight_initializer_linear(self):
      """Tests for the output layer initializer in the linear multi-class case."""
      loading_initializer = (
          checkpoint_ops._load_and_remap_matrix_initializer(
              new_row_vocab_size=5,
              new_col_vocab_file=self.new_class_vocab_file,
              old_col_vocab_file=self.old_class_vocab_file,
              new_col_vocab_size=4,
              old_tensor_name="some_scope/embeddings",
              ckpt_path=[self.checkpoint_file],
              new_row_vocab_file=self.new_feature_vocab_file,
              old_row_vocab_file=self.old_feature_vocab_file,
              num_row_oov_buckets=1,
              num_col_oov_buckets=1,
              initializer=self.initializer,
          )
      )
  
      # The new weight matrix is of size
      # [5 feature vocab + 1 feature OOV, 4 class vocab + 1 class OOV].  Use a
      # partitioned variable to confirm that the offset logic works.
      expected_remapped_matrix = np.concatenate(
          [
              np.reshape(
                  [2, 18, 34, 50, self.init_val, self.init_val], [6, 1]
              ),
              np.reshape(
                  [0, 16, 32, 48, self.init_val, self.init_val], [6, 1]
              ),
              np.reshape([self.init_val] * 6, [6, 1]),
              np.reshape(
                  [1, 17, 33, 49, self.init_val, self.init_val], [6, 1]
              ),
              np.reshape([self.init_val] * 6, [6, 1]),
          ],
          axis=1,
      )
      remapped_matrix = variable_scope.get_variable(
          name="linear/obtained_weight_matrix",
          shape=[6, 5],
          initializer=loading_initializer,
          partitioner=partitioned_variables.fixed_size_partitioner(2),
      )
  
      with self.cached_session():
          self.evaluate(variables.global_variables_initializer())
          self.assertAllClose(
              expected_remapped_matrix, remapped_matrix.as_tensor()
          )
  
imports: import os
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import partitioned_variables
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.training import checkpoint_ops
  from tensorflow.python.training import saver
label_desc: Use image node_id 3 for calling the LoadAndRemapWrappersTest obj's underlying member method code with example usage: obj.test_load_and_remap_output_layer_weight_initializer_linear() without return types