Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions assignment/assignment1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"\n",
"def emit_te_example():\n",
" bb = relax.BlockBuilder()\n",
" x = relax.Var(\"x\", (128, 128), relax.DynTensorType(2, \"float32\"))\n",
" x = relax.Var(\"x\", relax.TensorStructInfo((128, 128), \"float32\"))\n",
" with bb.function(\"main\", [x]):\n",
" with bb.dataflow():\n",
" lv0 = bb.emit_te(relu, x)\n",
Expand Down Expand Up @@ -253,7 +253,7 @@
"source": [
"def create_model_via_emit_te():\n",
" bb = relax.BlockBuilder()\n",
" x = relax.Var(\"x\", input_shape, relax.DynTensorType(batch_size, \"float32\"))\n",
" x = relax.Var(\"x\", relax.TensorStructInfo(input_shape, \"float32\"))\n",
"\n",
" conv2d_weight = relax.const(weight_map[\"conv2d_weight\"], \"float32\")\n",
" conv2d_bias = relax.const(weight_map[\"conv2d_bias\"].reshape(1, 32, 1, 1), \"float32\")\n",
Expand All @@ -272,7 +272,7 @@
"\n",
"\n",
"def build_mod(mod):\n",
" exec = relax.vm.build(mod, \"llvm\")\n",
" exec = relax.build(mod, \"llvm\")\n",
" dev = tvm.cpu()\n",
" vm = relax.VirtualMachine(exec, dev)\n",
" return vm\n",
Expand Down Expand Up @@ -362,7 +362,7 @@
"def create_model_with_torch_func():\n",
" bb = relax.BlockBuilder()\n",
"\n",
" x = relax.Var(\"x\", input_shape, relax.DynTensorType(4, \"float32\"))\n",
" x = relax.Var(\"x\", relax.TensorStructInfo(input_shape, \"float32\"))\n",
"\n",
" conv2d_weight = relax.const(weight_map[\"conv2d_weight\"], \"float32\")\n",
" conv2d_bias = relax.const(weight_map[\"conv2d_bias\"].reshape(1, 32, 1, 1), \"float32\")\n",
Expand Down
8 changes: 4 additions & 4 deletions assignment/assignment1_zh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
"\n",
"def emit_te_example():\n",
" bb = relax.BlockBuilder()\n",
" x = relax.Var(\"x\", (128, 128), relax.DynTensorType(2, \"float32\"))\n",
" x = relax.Var(\"x\", relax.TensorStructInfo((128, 128), \"float32\"))\n",
" with bb.function(\"main\", [x]):\n",
" with bb.dataflow():\n",
" lv0 = bb.emit_te(relu, x)\n",
Expand Down Expand Up @@ -252,7 +252,7 @@
"source": [
"def create_model_via_emit_te():\n",
" bb = relax.BlockBuilder()\n",
" x = relax.Var(\"x\", input_shape, relax.DynTensorType(batch_size, \"float32\"))\n",
" x = relax.Var(\"x\", relax.TensorStructInfo(input_shape, \"float32\"))\n",
"\n",
" conv2d_weight = relax.const(weight_map[\"conv2d_weight\"], \"float32\")\n",
" conv2d_bias = relax.const(weight_map[\"conv2d_bias\"].reshape(1, 32, 1, 1), \"float32\")\n",
Expand All @@ -271,7 +271,7 @@
"\n",
"\n",
"def build_mod(mod):\n",
" exec = relax.vm.build(mod, \"llvm\")\n",
" exec = relax.build(mod, \"llvm\")\n",
" dev = tvm.cpu()\n",
" vm = relax.VirtualMachine(exec, dev)\n",
" return vm\n",
Expand Down Expand Up @@ -362,7 +362,7 @@
"def create_model_with_torch_func():\n",
" bb = relax.BlockBuilder()\n",
"\n",
" x = relax.Var(\"x\", input_shape, relax.DynTensorType(4, \"float32\"))\n",
" x = relax.Var(\"x\", relax.TensorStructInfo(input_shape, \"float32\"))\n",
"\n",
" conv2d_weight = relax.const(weight_map[\"conv2d_weight\"], \"float32\")\n",
" conv2d_bias = relax.const(weight_map[\"conv2d_bias\"].reshape(1, 32, 1, 1), \"float32\")\n",
Expand Down