def linear_interpolate(tensor1, tensor2, coeffs):
  """Linearly interpolate between two tensors at coeff.

  Args:
    tensor1: 4-D Tensor, shape=(NHWC)
    tensor2: 4-D Tensor, shape=(NHWC)
    coeffs: list of floats.
  Returns:
    interp_latents: 5-D Tensor, with interp_latents[i] representing
                    interpolations at coeffs[i].
                    shape=(len(coeffs), NHWC)
  """
  interp_tensors = []
  for coeff in coeffs:
    interp_tensor = tensor1 + coeff * (tensor2 - tensor1)
    interp_tensors.append(interp_tensor)
  return tf.concat(interp_tensors, axis=0)
Linearly interpolate between two tensors at coeff.

  Args:
    tensor1: 4-D Tensor, shape=(NHWC)
    tensor2: 4-D Tensor, shape=(NHWC)
    coeffs: list of floats.
  Returns:
    interp_latents: 5-D Tensor, with interp_latents[i] representing
                    interpolations at coeffs[i].
                    shape=(len(coeffs), NHWC)
  
tensor2tensor/models/research/glow_ops.py