parameters: (input, name=None)
return_statement: return tf.tensordot(input, tf.transpose(kernel), axes=((-1,), (0,)))
docstring: Convert a RGB image to YPbPr.
  
      Args:
        input: A 3-D (`[H, W, 3]`) or 4-D (`[N, H, W, 3]`) Tensor.
        name: A name for the operation (optional).
  
      Returns:
        A 3-D (`[H, W, 3]`) or 4-D (`[N, H, W, 3]`) Tensor.
docstring_summary: Convert a RGB image to YPbPr.
docstring_tokens: Convert a RGB image to YPbPr .
function: def rgb_to_ypbpr(input, name=None):
      """
      Convert a RGB image to YPbPr.
  
      Args:
        input: A 3-D (`[H, W, 3]`) or 4-D (`[N, H, W, 3]`) Tensor.
        name: A name for the operation (optional).
  
      Returns:
        A 3-D (`[H, W, 3]`) or 4-D (`[N, H, W, 3]`) Tensor.
      """
      input = tf.convert_to_tensor(input)
      assert input.dtype in (tf.float16, tf.float32, tf.float64)
  
      kernel = tf.constant(
          [
              [0.299, 0.587, 0.114],
              [-0.168736, -0.331264, 0.5],
              [0.5, -0.418688, -0.081312],
          ],
          input.dtype,
      )
  
      return tf.tensordot(input, tf.transpose(kernel), axes=((-1,), (0,)))
function_tokens: def rgb_to_ypbpr ( input , name = None ) : input = tf . convert_to_tensor ( input ) assert input . dtype in ( tf . float16 , tf . float32 , tf . float64 ) kernel = tf . constant ( [ [ 0.299 , 0.587 , 0.114 ] , [ - 0.168736 , - 0.331264 , 0.5 ] , [ 0.5 , - 0.418688 , - 0.081312 ] , ] , input . dtype , ) return tf . tensordot ( input , tf . transpose ( kernel ) , axes = ( ( - 1 , ) , ( 0 , ) ) )