def expected(): conv2d_1 = relay.nn.conv2d( data1, weight, channels=64, kernel_size=(3, 3), padding=(1, 1)) device_copy1 = relay.device_copy(conv2d_1, dev2, dev1) conv2d_2 = relay.nn.conv2d( data2, weight, channels=64, kernel_size=(3, 3), padding=(1, 1)) device_copy2 = relay.device_copy(conv2d_2, dev2, dev1) add = relay.add(device_copy1, device_copy2) device_copy3 = relay.device_copy(add, dev1, dev2) conv2d_3 = relay.nn.conv2d( device_copy3, weight, channels=64, kernel_size=(3, 3), padding=(1, 1)) func = relay.Function([data1, weight, data2], conv2d_3) return func
def expected(): conv2d_1 = relay.nn.conv2d( data1, weight, channels=64, kernel_size=(3, 3), padding=(1, 1)) device_copy1 = relay.device_copy(conv2d_1, dev2, dev1) conv2d_2 = relay.nn.conv2d( data2, weight, channels=64, kernel_size=(3, 3), padding=(1, 1)) device_copy2 = relay.device_copy(conv2d_2, dev2, dev1) add = relay.add(device_copy1, device_copy2) device_copy3 = relay.device_copy(add, dev1, dev2) conv2d_3 = relay.nn.conv2d( device_copy3, weight, channels=64, kernel_size=(3, 3), padding=(1, 1)) func = relay.Function([data1, data2, weight], conv2d_3) return func
def expected(): x = relay.var("x", relay.ty.TensorType((3, 3, 4), "float32")) split = relay.op.split(x, 3) elem0 = relay.device_copy(split[0], gpu_dev, cpu_dev) elem1 = relay.device_copy(split[1], gpu_dev, cpu_dev) sub = elem0 - elem1 func = relay.Function(relay.analysis.free_vars(sub), sub) return func
def expected(): add = relay.add(x, y) copy_add_sub1 = relay.device_copy(add, dev2, dev1) sub1 = relay.subtract(copy_add_sub1, z) copy_add_sub2 = relay.device_copy(add, dev2, dev1) sub2 = relay.subtract(copy_add_sub2, z) func = relay.Function([x, y, z], relay.Tuple([sub1, sub2])) return func
def expected(): add = relay.add(x, y) copy_add_sqrt = relay.device_copy(add, cpu_dev, dev_dev) sqrt = relay.sqrt(copy_add_sqrt) log = relay.log(add) copy_sqrt_subtract = relay.device_copy(sqrt, dev_dev, cpu_dev) subtract = relay.subtract(copy_sqrt_subtract, log) copy_sub_exp = relay.device_copy(subtract, cpu_dev, dev_dev) exp = relay.exp(copy_sub_exp) func = relay.Function([x, y], exp) return func
def expected(): log = relay.log(x) _log_left = relay.device_copy(log, dev1, dev2) _log_right = relay.device_copy(log, dev1, dev2) log2 = relay.log2(_log_left) log10 = relay.log10(_log_right) add = relay.add(log2, log10) _add = relay.device_copy(add, dev2, dev1) tan = relay.tan(_add) func = run_opt_pass(tan, transform.InferType()) return func
def expected(): add = relay.add(x, y) copy_add_sqrt = relay.device_copy(add, cpu_ctx, dev_ctx) sqrt = relay.sqrt(copy_add_sqrt) log = relay.log(add) copy_sqrt_subtract = relay.device_copy(sqrt, dev_ctx, cpu_ctx) subtract = relay.subtract(copy_sqrt_subtract, log) copy_sub_exp = relay.device_copy(subtract, cpu_ctx, dev_ctx) exp = relay.exp(copy_sub_exp) func = relay.Function([x, y], exp) return func
def expected(): add = relay.add(a, b) mul = relay.multiply(c, d) copy_mul_sub = relay.device_copy(mul, cpu_dev, dev_dev) sub = relay.subtract(add, copy_mul_sub) func = relay.Function([a, b, c, d], sub) return func
def expected(): add = relay.add(a, b) mul = relay.multiply(c, d) copy_mul_sub = relay.device_copy(mul, cpu_ctx, dev_ctx) sub = relay.subtract(add, copy_mul_sub) func = relay.Function([a, b, c, d], sub) return func
def expected(): add = relay.add(x, y) sqrt = relay.sqrt(add) log = relay.log(add) subtract = relay.subtract(sqrt, log) copy_sub_exp = relay.device_copy(subtract, dev_ctx, cpu_ctx) exp = relay.exp(copy_sub_exp) func = relay.Function([x, y], exp) return func
def expected(): add = relay.add(x, y) copy_add_sub = relay.device_copy(add, dev1, dev2) sub = relay.subtract(copy_add_sub, z) return sub
def expected(): add = relay.add(x, y) copy_add_sub = relay.device_copy(add, ctx2, ctx1) sub = relay.subtract(copy_add_sub, z) func = relay.Function([x, y, z], sub) return func