def wrap(op, minval, maxval, shape, shape_dtype, dtype, seed, **kwargs):
    shape_ = (constant_op.constant(shape, dtype=shape_dtype)
              if shape_dtype is not None else shape)
    return op(
        seed=seed, shape=shape_, minval=minval, maxval=maxval, dtype=dtype,
        **kwargs)