'Yield a context under a cached name scope, whose name is the name of
this InputSource class.'

@contextmanager
def cached_name_scope(self):

    if self._name_scope:
        with tf.name_scope(self._name_scope):
            (yield self._name_scope)
    else:
        name = type(self).__name__
        with tf.name_scope(name) as ns:
            self._name_scope = ns
            (yield ns)
