title: Tensorflow parameter rework to tuple
body: <p>I have code in several places that takes a tuple, but can take a list, or single number. Usage is where I want an image size like (h,w), for example (256,128), but it also can take [256,128] or just 128 to be (128,128) or even a single float that gets repeated and cast to int.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>    if isinstance(mp_reduction_shape, int) or isinstance(mp_reduction_shape, float):
          self.mp_reduction_h = int(mp_reduction_shape)
          self.mp_reduction_w = int(mp_reduction_shape)
      elif isinstance(mp_reduction_shape, tuple) or isinstance(mp_reduction_shape, list):
          self.mp_reduction_h = int(mp_reduction_shape[0])
          if len(mp_reduction_shape) == 1:
              self.mp_reduction_w = int(mp_reduction_shape[0])
          else:
              self.mp_reduction_w = int(mp_reduction_shape[1])
      else:
          self.mp_reduction_h = int(mp_reduction_shape[0])
          self.mp_reduction_w = int(mp_reduction_shape[1])
  </code></pre>
  
  <p>Is there a builtin function to do this in tensorflow or python?
  Is this even the right approach for this type of parameter passing?</p>