# Path: ldif/util/line_util.py
# def line_to_image(line_parameters, height, width, falloff=2.0):
# def fractional_vector_projection(e0, e1, p, falloff=2.0):
# def rotate_about_point(angle_of_rotation, point, to_rotate):
# def union_of_line_drawings(lines):
# def network_line_parameters_to_line(line_parameters, height, width):
# 
# Path: ldif/util/net_util.py
# def twin_inference(inference_fun, observation, element_count,
#                    flat_element_length, model_config):
# def get_normalizer_and_mode(model_config):
# def conv_layer(inputs, depth, model_config):
# def maxpool2x2_layer(inputs):
# def down_layer(inputs, depth, model_config):
# def up_layer(inputs, spatial_dims, depth, model_config):
# def encode(inputs,
#            model_config,
#            conv_layer_depths,
#            fc_layer_depths,
#            name='Encoder'):
# def inputs_to_feature_vector(inputs, feature_length, model_config):
# def decode(z,
#            model_config,
#            spatial_dims,
#            fc_layer_depths,
#            conv_layer_depths,
#            output_dim,
#            name='Decoder'):
# def residual_layer(inputs, num_outputs, model_config):


import tensorflow as tf
from ldif.util import line_util
from ldif.util import net_util
      conv_layer_depths=conv_layer_depths,
      fc_layer_depths=[encoded_image_length],
      name='Encoder')
  if reencode_partial_outputs:
    encoded_partial_output, _, _ = net_util.encode(
        tf.ones_like(inputs),
        model_config,
        conv_layer_depths=conv_layer_depths,
        fc_layer_depths=[encoded_image_length],
        name='OutputReencoder')
  else:
    encoded_partial_output = None

  lstm = tf.contrib.rnn.MultiRNNCell([
      tf.contrib.rnn.BasicLSTMCell(lstm_size) for _ in range(number_of_layers)
  ])

  state = lstm.zero_state(batch_size, tf.float32)
  partial_images = []
  for i in range(number_of_lines):
    if reencode_partial_outputs:
      embedding_in = tf.concat([encoded_image, encoded_partial_output], axis=-1)
    else:
      embedding_in = encoded_image
    output, state = lstm(embedding_in, state)
    line_parameters = tf.contrib.layers.fully_connected(
        inputs=output,
        num_outputs=line_embedding_size,
        activation_fn=None,
        normalizer_fn=None)

# Path: ldif/util/line_util.py
# def line_to_image(line_parameters, height, width, falloff=2.0):
# def fractional_vector_projection(e0, e1, p, falloff=2.0):
# def rotate_about_point(angle_of_rotation, point, to_rotate):
# def union_of_line_drawings(lines):
# def network_line_parameters_to_line(line_parameters, height, width):
# 
# Path: ldif/util/net_util.py
# def twin_inference(inference_fun, observation, element_count,
#                    flat_element_length, model_config):
# def get_normalizer_and_mode(model_config):
# def conv_layer(inputs, depth, model_config):
# def maxpool2x2_layer(inputs):
# def down_layer(inputs, depth, model_config):
# def up_layer(inputs, spatial_dims, depth, model_config):
# def encode(inputs,
#            model_config,
#            conv_layer_depths,
#            fc_layer_depths,
#            name='Encoder'):
# def inputs_to_feature_vector(inputs, feature_length, model_config):
# def decode(z,
#            model_config,
#            spatial_dims,
#            fc_layer_depths,
#            conv_layer_depths,
#            output_dim,
#            name='Decoder'):
# def residual_layer(inputs, num_outputs, model_config):


# Path: ldif/nets/linenet.py
import tensorflow as tf
from ldif.util import line_util
from ldif.util import net_util

      conv_layer_depths=conv_layer_depths,
      fc_layer_depths=[encoded_image_length],
      name='Encoder')
  if reencode_partial_outputs:
    encoded_partial_output, _, _ = net_util.encode(
        tf.ones_like(inputs),
        model_config,
        conv_layer_depths=conv_layer_depths,
        fc_layer_depths=[encoded_image_length],
        name='OutputReencoder')
  else:
    encoded_partial_output = None

  lstm = tf.contrib.rnn.MultiRNNCell([
      tf.contrib.rnn.BasicLSTMCell(lstm_size) for _ in range(number_of_layers)
  ])

  state = lstm.zero_state(batch_size, tf.float32)
  partial_images = []
  for i in range(number_of_lines):
    if reencode_partial_outputs:
      embedding_in = tf.concat([encoded_image, encoded_partial_output], axis=-1)
    else:
      embedding_in = encoded_image
    output, state = lstm(embedding_in, state)
    line_parameters = tf.contrib.layers.fully_connected(
        inputs=output,
        num_outputs=line_embedding_size,
        activation_fn=None,
        normalizer_fn=None)

    current_image = line_util.network_line_parameters_to_line(