(self, char_index)
return feature
Returns a subset of image features for a character.

    Args:
      char_index: an index of a character.

    Returns:
      A tensor with shape [batch_size, ?]. The output depth depends on the
      depth of input net.
Returns a subset of image features for a character.
Returns a subset of image features for a character .
def get_image_feature(self, char_index):
    """Returns a subset of image features for a character.

    Args:
      char_index: an index of a character.

    Returns:
      A tensor with shape [batch_size, ?]. The output depth depends on the
      depth of input net.
    """
    batch_size, features_num, _ = [d.value for d in self._net.get_shape()]
    slice_len = int(features_num / self._params.seq_length)
    # In case when features_num != seq_length, we just pick a subset of image
    # features, this choice is arbitrary and there is no intuitive geometrical
    # interpretation. If features_num is not dividable by seq_length there will
    # be unused image features.
    net_slice = self._net[:, char_index:char_index + slice_len, :]
    feature = tf.reshape(net_slice, [batch_size, -1])
    logging.debug('Image feature: %s', feature)
    return feature
def get_image_feature ( self , char_index ) : batch_size , features_num , _ = [ d . value for d in self . _net . get_shape ( ) ] slice_len = int ( features_num / self . _params . seq_length ) # In case when features_num != seq_length, we just pick a subset of image # features, this choice is arbitrary and there is no intuitive geometrical # interpretation. If features_num is not dividable by seq_length there will # be unused image features. net_slice = self . _net [ : , char_index : char_index + slice_len , : ] feature = tf . reshape ( net_slice , [ batch_size , - 1 ] ) logging . debug ( 'Image feature: %s' , feature ) return feature