title: Concept of getter in TensorFlow
body: <p>In TensorFlow what is the concept and use of getter ?</p>
  
  <p>The signature of <code>tf.get_variable()</code> is :</p>
  
  <pre><code>get_variable(
      name,
      shape=None,
      dtype=None,
      initializer=None,
      regularizer=None,
      trainable=True,
      collections=None,
      caching_device=None,
      partitioner=None,
      validate_shape=True,
      use_resource=None,
      custom_getter=None
  )
  </code></pre>
  
  <p>The definition of <code>custom_getter</code> is given in the documentation as follows :</p>
  
  <blockquote>
    <p><strong>custom_getter:</strong> Callable that takes as a first argument the true
    getter, and allows overwriting the internal get_variable method. The
    signature of custom_getter should match that of this method, but the
    most future-proof version will allow for changes: def
    custom_getter(getter, *args, **kwargs). Direct access to all
    get_variable parameters is also allowed: def custom_getter(getter,
    name, *args, **kwargs). A simple identity custom getter that simply
    creates variables with modified names is: python def
    custom_getter(getter, name, *args, **kwargs): return getter(name +
    '_suffix', *args, **kwargs)</p>
  </blockquote>
  
  <p>Unfortunately it is not very clear. Could someone please expand on it ?</p>