there isn’t an in-built way to do this.
However, you can simply write this as an autograd function
def rgb_to_ycbcr(input):
  # input is mini-batch N x 3 x H x W of an RGB image
  output = Variable(input.data.new(*input.size()))
  output[:, 0, :, :] = input[:, 0, :, :] * 65.481 + input[:, 1, :, :] * 128.553 + input[:, 2, :, :] * 24.966 + 16
  # similarly write output[:, 1, :, :] and output[:, 2, :, :] using formulas from https://en.wikipedia.org/wiki/YCbCr
  return output