def METHOD_NAME(self, n, gc, dc):
    slopes = np.random.uniform(-1, 1, (2, n)).astype(np.float32)
    intercepts = np.random.uniform(-1, 1, (2, n)).astype(np.float32)
    bounds = np.random.uniform(0.1, 0.9,
                               (2, n + 1)).astype(np.float32)
    bounds.sort()
    X = np.random.uniform(0, 1, (n, 2)).astype(np.float32)
    op = core.CreateOperator(
        "PiecewiseLinearTransform", ["X"], ["Y"],
        bounds=bounds.flatten().tolist(),
        slopes=slopes.flatten().tolist(),
        intercepts=intercepts.flatten().tolist(),
    )
    def piecewise(x, *args, **kw):
        x_0 = self.transform(
            x[:, 0], bounds[0, :], slopes[0, :], intercepts[0, :])
        x_1 = self.transform(
            x[:, 1], bounds[1, :], slopes[1, :], intercepts[1, :])
        return [np.vstack((x_0, x_1)).transpose()]
    self.assertReferenceChecks(gc, op, [X], piecewise)
    self.assertDeviceChecks(dc, op, [X], [0])