code: def givens_reflection(r, x):
      """Applies 2x2 reflections.
  
      Args:
        r: Tensor of size B x d representing relfection parameters per example.
        x: Tensor of size B x d representing points to reflect.
  
      Returns:
        Tensor of size B x s representing reflection of x by r.
      """
      batch_size = tf.shape(r)[0]
      givens = tf.reshape(r, (batch_size, -1, 2))
      givens = givens / tf.norm(givens, ord=2, axis=-1, keepdims=True)
      x = tf.reshape(x, (batch_size, -1, 2))
      x_ref = givens[:, :, 0:1] * tf.concat(
          (x[:, :, 0:1], -x[:, :, 1:]), axis=-1
      ) + givens[:, :, 1:] * tf.concat(
          (x[:, :, 1:], x[:, :, 0:1]), axis=-1
      )
      return tf.reshape(x_ref, (batch_size, -1))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: givens_reflection(r, x) and returns: tf