def bilinear_sampling(input_layer, x, y, name=PROVIDED):
  """Performs bilinear sampling. This must be a rank 4 Tensor.

  Implements the differentiable sampling mechanism with bilinear kernel
  in https://arxiv.org/abs/1506.02025.

  Given (x, y) coordinates for each output pixel, use bilinear sampling on
  the input_layer to fill the output.

  Args:
    input_layer: The chainable object, supplied.
    x: A tensor of size [batch_size, height, width, 1] representing the sampling
      x coordinates normalized to range [-1,1].
    y: A tensor of size [batch_size, height, width, 1] representing  the
      sampling y coordinates normalized to range [-1,1].
    name: The name for this operation is also used to create/find the
      parameter variables.
  Returns:
    Handle to this layer
  """
  input_layer.get_shape().assert_has_rank(4)
  return _interpolate(im=input_layer, x=x, y=y, name=name)
Performs bilinear sampling. This must be a rank 4 Tensor.

  Implements the differentiable sampling mechanism with bilinear kernel
  in https://arxiv.org/abs/1506.02025.

  Given (x, y) coordinates for each output pixel, use bilinear sampling on
  the input_layer to fill the output.

  Args:
    input_layer: The chainable object, supplied.
    x: A tensor of size [batch_size, height, width, 1] representing the sampling
      x coordinates normalized to range [-1,1].
    y: A tensor of size [batch_size, height, width, 1] representing  the
      sampling y coordinates normalized to range [-1,1].
    name: The name for this operation is also used to create/find the
      parameter variables.
  Returns:
    Handle to this layer