import tensorflow as tf

from .conv import multi_conv
from .layer import fully_connected
from .util import static_rank, static_shape, funcname_scope



@funcname_scope
def font2char(fonts, *, dropout_prob, char_embedding_size, **conv_hyperparams):
  assert static_rank(fonts) == 3

  images = tf.expand_dims(fonts, -1)
  tf.image_summary("fonts", images, max_images=4096)

  return fully_connected(
      tf.reshape(multi_conv(images, **conv_hyperparams),
                 [static_shape(fonts)[0], -1]),
      dropout_prob=dropout_prob,
      output_layer_size=char_embedding_size,
      activate=tf.nn.elu)

@@ -82,16 +82,48 @@
 nnected%0A
+from .random import sample_crop%0A
 from .ut
@@ -376,31 +376,30 @@
 s%22, 
-images, max_
+sample_crop(
 images
-=4096
+, 8)
 )%0A%0A 

Make font summary memory-efficient