def METHOD_NAME(device):
    pipe = Pipeline(batch_size=1, num_threads=1, device_id=0)
    image = np.array([
        [1, 2,  3,  4],
        [5, 6,  7,  8],
        [9, 10, 11, 12]], dtype=np.uint8)[:, :, np.newaxis]
    batch = [image]
    input = fn.external_source([batch], layout="HWC")
    rotated = fn.rotate(input.gpu() if device == "gpu" else input,
                        angle=90)
    pipe.set_outputs(rotated)
    pipe.build()
    outs = pipe.run()
    out = outs[0] if device == "cpu" else outs[0].as_cpu()
    arr = out.at(0)
    ref = np.array([
        [4, 8, 12],
        [3, 7, 11],
        [2, 6, 10],
        [1, 5, 9]])[:, :, np.newaxis]
    assert np.array_equal(arr, ref)