code: def reshape_to_matrix(input_tensor):
      """Reshapes a >= rank 2 tensor to a rank 2 tensor (i.e., a matrix)."""
      ndims = input_tensor.shape.ndims
      if ndims < 2:
          raise ValueError(
              "Input tensor must have at least rank 2. Shape = %s"
              % (input_tensor.shape)
          )
      if ndims == 2:
          return input_tensor
  
      width = input_tensor.shape[-1]
      output_tensor = tf.reshape(input_tensor, [-1, width])
      return output_tensor
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import copy
  import json
  import math
  import re
  import numpy
  import six
  import tensorflow
label_desc: Use image node_id 14 for calling a global function with example usage: reshape_to_matrix(input_tensor) and returns: output_tensor, input_tensor