(max_outputs, categorical=False)
return convert_to_svg
Binds the number of outputs to the image conversion fn (to svg or png).
Binds the number of outputs to the image conversion fn (to svg or png).
Binds the number of outputs to the image conversion fn ( to svg or png ) .
def create_image_conversion_fn(max_outputs, categorical=False):
  """Binds the number of outputs to the image conversion fn (to svg or png)."""
  def convert_to_svg(decoder_output):
    converted = []
    for example in decoder_output:
      if len(converted) == max_outputs:
        break
      converted.append(vector_to_svg(example, True, categorical=categorical))
    return np.array(converted)

  return convert_to_svg
def create_image_conversion_fn ( max_outputs , categorical = False ) : def convert_to_svg ( decoder_output ) : converted = [ ] for example in decoder_output : if len ( converted ) == max_outputs : break converted . append ( vector_to_svg ( example , True , categorical = categorical ) ) return np . array ( converted ) return convert_to_svg