# Path: ldif/util/file_util.py
# def readlines(p):
# def readbin(p):
# def writebin(p, s):
# def writetxt(p, s):
# def write_np(path, arr):
# def read_grd(path):
# def read_sif_v1(path, verbose=False):
# def read_lines(p):
# def read_image(p):
# def read_npz(p):
# def read_np(p):
# def read_txt_to_np(p):
# def read_py2_pkl(p):
# def write_mesh(path, mesh):
# def read_mesh(path):
# def read_csv(path):
# def read_normals(path_to_dir, im_count=20, leading='_depth'):
# def write_points(path_ext_optional, points):
# def write_grd(path, volume, world2grid=None):
# def write_depth_image(path, depth_image):


import tensorflow as tf
from ldif.util.file_util import log
                    data_format)

  for _ in range(1, blocks):
    inputs = block_fn(inputs, filters, training, None, 1, data_format)

  return tf.identity(inputs, name)


def resize(inputs, height, width, data_format):
  if data_format == 'channels_first':
    inputs = tf.transpose(inputs, perm=[0, 2, 3, 1])
  else:
    assert data_format == 'channels_last'
  output_res = tf.stack([height, width])
  output = tf.image.resize_images(inputs, output_res, align_corners=True)
  if data_format == 'channels_first':
    output = tf.transpose(output, perm=[0, 3, 1, 2])
  return output


def assert_shape(tensor, shape, name):
  """Fails an assert if the tensor fails the shape compatibility check."""
  real_shape = tensor.get_shape().as_list()
  same_rank = len(real_shape) == len(shape)
  values_different = [
      1 for i in range(min(len(shape), len(real_shape)))
      if shape[i] != real_shape[i] and shape[i] != -1
  ]
  all_equal = not values_different
  if not same_rank or not all_equal:

# Path: ldif/util/file_util.py
# def readlines(p):
# def readbin(p):
# def writebin(p, s):
# def writetxt(p, s):
# def write_np(path, arr):
# def read_grd(path):
# def read_sif_v1(path, verbose=False):
# def read_lines(p):
# def read_image(p):
# def read_npz(p):
# def read_np(p):
# def read_txt_to_np(p):
# def read_py2_pkl(p):
# def write_mesh(path, mesh):
# def read_mesh(path):
# def read_csv(path):
# def read_normals(path_to_dir, im_count=20, leading='_depth'):
# def write_points(path_ext_optional, points):
# def write_grd(path, volume, world2grid=None):
# def write_depth_image(path, depth_image):


# Path: ldif/nets/resnet_unet.py
import tensorflow as tf
from ldif.util.file_util import log

                    data_format)

  for _ in range(1, blocks):
    inputs = block_fn(inputs, filters, training, None, 1, data_format)

  return tf.identity(inputs, name)


def resize(inputs, height, width, data_format):
  if data_format == 'channels_first':
    inputs = tf.transpose(inputs, perm=[0, 2, 3, 1])
  else:
    assert data_format == 'channels_last'
  output_res = tf.stack([height, width])
  output = tf.image.resize_images(inputs, output_res, align_corners=True)
  if data_format == 'channels_first':
    output = tf.transpose(output, perm=[0, 3, 1, 2])
  return output


def assert_shape(tensor, shape, name):
  """Fails an assert if the tensor fails the shape compatibility check."""
  real_shape = tensor.get_shape().as_list()
  same_rank = len(real_shape) == len(shape)
  values_different = [
      1 for i in range(min(len(shape), len(real_shape)))
      if shape[i] != real_shape[i] and shape[i] != -1
  ]
  all_equal = not values_different
  if not same_rank or not all_equal:

    log.info(