parameters: (image, offset_height, offset_width, target_height,
                           target_width)
return_statement: return cropped
docstring: Crops an image to a specified bounding box.
  
    This op cuts a rectangular part out of `image`. The top-left corner of the
    returned image is at `offset_height, offset_width` in `image`, and its
    lower-right corner is at
    `offset_height + target_height, offset_width + target_width`.
  
    Args:
      image: 3-D tensor with shape `[height, width, channels]`
      offset_height: Vertical coordinate of the top-left corner of the result in
                     the input.
      offset_width: Horizontal coordinate of the top-left corner of the result in
                    the input.
      target_height: Height of the result.
      target_width: Width of the result.
  
    Returns:
      3-D tensor of image with shape `[target_height, target_width, channels]`
  
    Raises:
      ValueError: If the shape of `image` is incompatible with the `offset_*` or
        `target_*` arguments, or either `offset_height` or `offset_width` is
        negative, or either `target_height` or `target_width` is not positive.
docstring_summary: Crops an image to a specified bounding box.
docstring_tokens: Crops an image to a specified bounding box .
function: def crop_to_bounding_box(image, offset_height, offset_width, target_height,
                           target_width):
    """Crops an image to a specified bounding box.
  
    This op cuts a rectangular part out of `image`. The top-left corner of the
    returned image is at `offset_height, offset_width` in `image`, and its
    lower-right corner is at
    `offset_height + target_height, offset_width + target_width`.
  
    Args:
      image: 3-D tensor with shape `[height, width, channels]`
      offset_height: Vertical coordinate of the top-left corner of the result in
                     the input.
      offset_width: Horizontal coordinate of the top-left corner of the result in
                    the input.
      target_height: Height of the result.
      target_width: Width of the result.
  
    Returns:
      3-D tensor of image with shape `[target_height, target_width, channels]`
  
    Raises:
      ValueError: If the shape of `image` is incompatible with the `offset_*` or
        `target_*` arguments, or either `offset_height` or `offset_width` is
        negative, or either `target_height` or `target_width` is not positive.
    """
    image = ops.convert_to_tensor(image, name='image')
  
    assert_ops = []
    assert_ops += _Check3DImage(image, require_static=False)
  
    height, width, depth = _ImageDimensions(image, static_only=False)
  
    assert_ops += _assert(offset_width >= 0, ValueError,
                          'offset_width must be >= 0.')
    assert_ops += _assert(offset_height >= 0, ValueError,
                          'offset_height must be >= 0.')
    assert_ops += _assert(target_width > 0, ValueError,
                          'target_width must be > 0.')
    assert_ops += _assert(target_height > 0, ValueError,
                          'target_height must be > 0.')
    assert_ops += _assert(width >= (target_width + offset_width), ValueError,
                          'width must be >= target + offset.')
    assert_ops += _assert(height >= (target_height + offset_height), ValueError,
                          'height must be >= target + offset.')
    image = control_flow_ops.with_dependencies(assert_ops, image)
  
    cropped = array_ops.slice(
      image,
      array_ops.pack([offset_height, offset_width, 0]),
      array_ops.pack([target_height, target_width, -1]))
  
    cropped_shape = [None if is_tensor(i) else i
                     for i in [target_height, target_width, depth]]
    cropped.set_shape(cropped_shape)
  
    return cropped
function_tokens: def crop_to_bounding_box ( image , offset_height , offset_width , target_height , target_width ) : image = ops . convert_to_tensor ( image , name = 'image' ) assert_ops = [ ] assert_ops += _Check3DImage ( image , require_static = False ) height , width , depth = _ImageDimensions ( image , static_only = False ) assert_ops += _assert ( offset_width >= 0 , ValueError , 'offset_width must be >= 0.' ) assert_ops += _assert ( offset_height >= 0 , ValueError , 'offset_height must be >= 0.' ) assert_ops += _assert ( target_width > 0 , ValueError , 'target_width must be > 0.' ) assert_ops += _assert ( target_height > 0 , ValueError , 'target_height must be > 0.' ) assert_ops += _assert ( width >= ( target_width + offset_width ) , ValueError , 'width must be >= target + offset.' ) assert_ops += _assert ( height >= ( target_height + offset_height ) , ValueError , 'height must be >= target + offset.' ) image = control_flow_ops . with_dependencies ( assert_ops , image ) cropped = array_ops . slice ( image , array_ops . pack ( [ offset_height , offset_width , 0 ] ) , array_ops . pack ( [ target_height , target_width , - 1 ] ) ) cropped_shape = [ None if is_tensor ( i ) else i for i in [ target_height , target_width , depth ] ] cropped . set_shape ( cropped_shape ) return cropped