(self, key)
Add related TF heads for a key if it is not used before.
Add related TF heads for a key if it is not used before.
Add related TF heads for a key if it is not used before .
def _add_key_if_not_exists(self, key):
    """Add related TF heads for a key if it is not used before."""
    if key in self._key_to_ph_summary_tuple:
      return
    placeholder = tf.placeholder(tf.float32, shape=(), name=key + '_ph')
    summary = tf.summary.scalar(key, placeholder)
    self._key_to_ph_summary_tuple[key] = (placeholder, summary)
def _add_key_if_not_exists ( self , key ) : if key in self . _key_to_ph_summary_tuple : return placeholder = tf . placeholder ( tf . float32 , shape = ( ) , name = key + '_ph' ) summary = tf . summary . scalar ( key , placeholder ) self . _key_to_ph_summary_tuple [ key ] = ( placeholder , summary )