This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tvm | |
from tvm import tir | |
from tvm.script import ty | |
@tvm.script.tir | |
def foo(a: ty.handle, b: ty.handle, c: ty.handle) -> None: | |
A = tir.match_buffer(a, (128,), "float32") | |
B = tir.match_buffer(b, (128,), "int32") | |
C = tir.match_buffer(c, (128,), "float32") | |
reducer = tir.comm_reducer(lambda x, y: (x + y), tir.float32(0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tvm | |
import tvm.relay as relay | |
x = relay.var("x", shape=(16,), dtype='float32') | |
y = relay.var("y", shape=(16,), dtype='float32') | |
c = relay.Let(x, y, x) | |
f = relay.Function([y], relay.expr.Tuple([c, c])) | |
mod = relay.Module.from_expr(f) | |
mod = relay.transform.PartialEvaluate()(mod) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import argparse | |
import tvm | |
import tvm.relay as relay | |
import tvm.relay.testing | |
from tvm.relay.testing import layers | |
import mxnet as mx | |
from mxnet import gluon | |
from mxnet.gluon.model_zoo import vision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import logging | |
import argparse | |
import os | |
import mxnet as mx | |
from mxnet import gluon | |
from mxnet.gluon.model_zoo import vision | |
import tvm | |
import tvm.relay as relay | |
import tvm.relay.expr as _expr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tvm | |
import tvm.relay as relay | |
import tvm.relay.testing | |
import numpy as np | |
x = relay.var("x", shape=(1, 16)) | |
y = relay.var("y", shape=(1, 16)) | |
z = relay.var("z", shape=(1, 16)) | |
cond = relay.var("cond", shape=(), dtype='uint1') | |
net = relay.If(cond, x, y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tvm | |
import tvm.relay as relay | |
import tvm.relay.testing | |
import numpy as np | |
x = relay.var("x", shape=(1, 16)) | |
y = relay.var("y", shape=(1, 16)) | |
z = relay.var("z", shape=(1, 16)) | |
cond = relay.var("cond", shape=(), dtype='uint1') | |
net = relay.If(cond, x, y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tvm | |
import tvm.relay as relay | |
''' | |
fn (%cond: bool) -> float32 { | |
let %x = fn () -> float32 { | |
let %x1 = 0f /* ty=float32 */ | |
%x1 | |
} | |
let %x2 = ref(%x) | |
let %x3 = if (%cond) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ======== | |
# captured on: Mon Apr 1 14:48:04 2019 | |
# os release : 4.15.0-42-generic | |
# perf version : 4.15.17 | |
# arch : x86_64 | |
# nrcpus online : 8 | |
# nrcpus avail : 8 | |
# cpudesc : Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz | |
# cpuid : GenuineIntel,6,94,3 | |
# total memory : 16341608 kB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ======== | |
# captured on: Mon Apr 1 15:38:30 2019 | |
# os release : 4.15.0-42-generic | |
# perf version : 4.15.17 | |
# arch : x86_64 | |
# nrcpus online : 8 | |
# nrcpus avail : 8 | |
# cpudesc : Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz | |
# cpuid : GenuineIntel,6,94,3 | |
# total memory : 16341608 kB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import json | |
parser = argparse.ArgumentParser() | |
parser.add_argument('in_file', type=str) | |
parser.add_argument('out_file', type=str) | |
args = parser.parse_args() | |
def transform(line): |
NewerOlder