This file contains hidden or 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
| .text | |
| .file "fused_nn_contrib_conv2d_NCHWc_add_cast_multiply_add_right_shift_add_cast_clip_ca_10134105474844747540__1" | |
| .globl fused_nn_contrib_conv2d_NCHWc_add_cast_multiply_add_right_shift_add_cast_clip_ca_10134105474844747540__1 | |
| .p2align 4, 0x90 | |
| .type fused_nn_contrib_conv2d_NCHWc_add_cast_multiply_add_right_shift_add_cast_clip_ca_10134105474844747540__1,@function | |
| fused_nn_contrib_conv2d_NCHWc_add_cast_multiply_add_right_shift_add_cast_clip_ca_10134105474844747540__1: | |
| .Lfunc_begin0: | |
| .cfi_startproc | |
| pushq %rbp | |
| .cfi_def_cfa_offset 16 |
This file contains hidden or 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 torch | |
| import tvm | |
| from tvm import relay | |
| from torchvision import models | |
| from tvm.relay.frontend.pytorch import from_pytorch, get_graph_input_names | |
| class SegmentationModelWrapper(torch.nn.Module): | |
| def __init__(self, model): |
This file contains hidden or 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
| graph(%self : __torch__.torch.nn.modules.module.Module, | |
| %input : Tensor): | |
| %2 : int[] = prim::Constant[value=[1, 1]]() | |
| %3 : bool = prim::Constant[value=0]() # /home/masa/projects/deep/pytorch/torch/nn/modules/conv.py:345:0 | |
| %4 : int[] = prim::Constant[value=[0, 0]]() | |
| %5 : int = prim::Constant[value=16]() # /home/masa/projects/deep/pytorch/torch/nn/modules/conv.py:345:0 | |
| %6 : bool = prim::Constant[value=1]() # /home/masa/projects/deep/pytorch/torch/nn/modules/conv.py:345:0 | |
| %7 : int = prim::BailoutTemplate_0() | |
| %8 : Float(1, 16, 224, 224) = prim::BailOut[index=0](%7, %input, %self) | |
| %9 : Tensor = prim::GetAttr[name="bias"](%self) |
This file contains hidden or 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 torch | |
| import tvm | |
| from tvm import relay | |
| from torchvision import models | |
| from torch_frontend import parse_script_module | |
| class SegmentationModelWrapper(torch.nn.Module): |
This file contains hidden or 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 torch | |
| import torchvision | |
| import numpy as np | |
| def do_script(model, in_size=100): | |
| model_script = torch.jit.script(model) | |
| model_script.eval() | |
| return model_script |
This file contains hidden or 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
| fn (%X: Tensor[(10, 20), float32]) -> Tensor[(10, 20), float32] { | |
| %0 = full(0 /* ty=int32 */, shape=[10, 20], dtype="float32") /* ty=Tensor[(10, 20), float32] */; | |
| %4 = ( | |
| let %while_loop: fn (int32, Tensor[(10, 20), float32]) -> (int32, Tensor[(10, 20), float32]) = fn (%i: int32, %a.6: Tensor[(10, 20), float32]) -> (int32, Tensor[(10, 20), float32]) { | |
| %1 = less(%i, 10 /* ty=int32 */) /* ty=bool */; | |
| if (%1) { | |
| %2 = add(%i, 1 /* ty=int32 */) /* ty=int32 */; | |
| %3 = add(%a.6, %X) /* ty=Tensor[(10, 20), float32] */; | |
| %while_loop(%2, %3) /* ty=(int32, Tensor[(10, 20), float32]) */ | |
| } else { |
This file contains hidden or 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
| before: v0.0.4 | |
| def @main(%x: Tensor[(2), float32]) -> Tensor[(2), float32] { | |
| let %while_loop: fn (int32, Tensor[(2), float32]) -> Tensor[(2), float32] = fn (%i: int32, %s: Tensor[(2), float32]) -> Tensor[(2), float32] { | |
| %0 = less(%i, 10 /* ty=int32 */) /* ty=bool */; | |
| if (%0) { | |
| %1 = add(%i, 1 /* ty=int32 */) /* ty=int32 */; | |
| %2 = add(%s, %x) /* ty=Tensor[(2), float32] */; | |
| %while_loop(%1, %2) /* ty=Tensor[(2), float32] */ | |
| } else { | |
| %s |
This file contains hidden or 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 os | |
| from packaging import version | |
| import numpy as np | |
| import tvm | |
| from tvm import relay | |
| import torch | |
| from torch import nn | |
| from torch.quantization.observer import MovingAverageMinMaxObserver, default_weight_observer | |
| from torchvision.models.quantization import resnet as qresnet | |
| from torchvision.models.quantization import mobilenet as qmobilenet |
This file contains hidden or 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 os | |
| import numpy as np | |
| import tvm | |
| from tvm import relay | |
| import torch | |
| from torch.quantization.observer import MovingAverageMinMaxObserver, default_weight_observer | |
| # from torchvision.models.quantization import shufflenetv2 as qshufflenetv2 | |
| from torch import nn | |
| from torch.quantization import QuantStub, DeQuantStub, fuse_modules | |
| from torch_frontend import parse_script_module |
This file contains hidden or 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 os | |
| import numpy as np | |
| import tvm | |
| from tvm import relay | |
| import torch | |
| from torch_frontend import parse_script_module | |