(image, require_static=True)
Assert that we are working with properly shaped image.

  Args:
    image: 3-D Tensor of shape [height, width, channels]
    require_static: If `True`, requires that all dimensions of `image` are
      known and non-zero.

  Raises:
    ValueError: if `image.shape` is not a 3-vector.

  Returns:
    An empty list, if `image` has fully defined dimensions. Otherwise, a list
    containing an assert op is returned.
Assert that we are working with properly shaped image.
Assert that we are working with properly shaped image .
def check_3d_image(image, require_static=True):
  """Assert that we are working with properly shaped image.

  Args:
    image: 3-D Tensor of shape [height, width, channels]
    require_static: If `True`, requires that all dimensions of `image` are
      known and non-zero.

  Raises:
    ValueError: if `image.shape` is not a 3-vector.

  Returns:
    An empty list, if `image` has fully defined dimensions. Otherwise, a list
    containing an assert op is returned.
  """
  try:
    image_shape = image.get_shape().with_rank(3)
  except ValueError:
    raise ValueError("'image' must be three-dimensional.")
  if require_static and not image_shape.is_fully_defined():
    raise ValueError("'image' must be fully defined.")
  if any(x == 0 for x in image_shape):
    raise ValueError("all dims of 'image.shape' must be > 0: %s" %
                     image_shape)
  if not image_shape.is_fully_defined():
    return [tf.assert_positive(tf.shape(image),
                                      ["all dims of 'image.shape' "
                                       "must be > 0."])]
  else:
    return []
def check_3d_image ( image , require_static = True ) : try : image_shape = image . get_shape ( ) . with_rank ( 3 ) except ValueError : raise ValueError ( "'image' must be three-dimensional." ) if require_static and not image_shape . is_fully_defined ( ) : raise ValueError ( "'image' must be fully defined." ) if any ( x == 0 for x in image_shape ) : raise ValueError ( "all dims of 'image.shape' must be > 0: %s" % image_shape ) if not image_shape . is_fully_defined ( ) : return [ tf . assert_positive ( tf . shape ( image ) , [ "all dims of 'image.shape' " "must be > 0." ] ) ] else : return [ ]