Created
June 5, 2019 17:00
-
-
Save lanpa/b5888c57ccfad66e3db2ce94bab53f62 to your computer and use it in GitHub Desktop.
result of jit.trace on torchvision's alexnet implementation
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
| trace = torch.jit.trace(model_alexnet, args_alexnet) | |
| graph = trace.graph | |
| print(graph) | |
| ============================================ | |
| .graph(%input.1 : Double(2, 3, 224, 224), | |
| %196 : Tensor, | |
| %197 : Tensor, | |
| %198 : Tensor, | |
| %199 : Tensor, | |
| %200 : Tensor, | |
| %201 : Tensor, | |
| %202 : Tensor, | |
| %203 : Tensor, | |
| %204 : Tensor, | |
| %205 : Tensor, | |
| %206 : Tensor, | |
| %207 : Tensor, | |
| %208 : Tensor, | |
| %209 : Tensor, | |
| %210 : Tensor, | |
| %211 : Tensor): | |
| %28 : int = prim::Constant[value=4](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %29 : int = prim::Constant[value=4](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %30 : int[] = prim::ListConstruct(%28, %29), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %31 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %32 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %33 : int[] = prim::ListConstruct(%31, %32), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %34 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %35 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %36 : int[] = prim::ListConstruct(%34, %35), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %37 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %38 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %39 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %40 : int[] = prim::ListConstruct(%38, %39), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %41 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %42 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %43 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %44 : bool = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %input.2 : Double(2, 64, 55, 55) = aten::_convolution(%input.1, %211, %210, %30, %33, %36, %37, %40, %41, %42, %43, %44), scope: AlexNet/Sequential[features]/Conv2d[0] | |
| %input.3 : Double(2, 64, 55, 55) = aten::relu_(%input.2), scope: AlexNet/Sequential[features]/ReLU[1] | |
| %47 : int = prim::Constant[value=3](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %48 : int = prim::Constant[value=3](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %49 : int[] = prim::ListConstruct(%47, %48), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %50 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %51 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %52 : int[] = prim::ListConstruct(%50, %51), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %53 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %54 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %55 : int[] = prim::ListConstruct(%53, %54), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %56 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %57 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %58 : int[] = prim::ListConstruct(%56, %57), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %59 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %input.4 : Double(2, 64, 27, 27) = aten::max_pool2d(%input.3, %49, %52, %55, %58, %59), scope: AlexNet/Sequential[features]/MaxPool2d[2] | |
| %61 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %62 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %63 : int[] = prim::ListConstruct(%61, %62), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %64 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %65 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %66 : int[] = prim::ListConstruct(%64, %65), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %67 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %68 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %69 : int[] = prim::ListConstruct(%67, %68), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %70 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %71 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %72 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %73 : int[] = prim::ListConstruct(%71, %72), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %74 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %75 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %76 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %77 : bool = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %input.5 : Double(2, 192, 27, 27) = aten::_convolution(%input.4, %209, %208, %63, %66, %69, %70, %73, %74, %75, %76, %77), scope: AlexNet/Sequential[features]/Conv2d[3] | |
| %input.6 : Double(2, 192, 27, 27) = aten::relu_(%input.5), scope: AlexNet/Sequential[features]/ReLU[4] | |
| %80 : int = prim::Constant[value=3](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %81 : int = prim::Constant[value=3](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %82 : int[] = prim::ListConstruct(%80, %81), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %83 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %84 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %85 : int[] = prim::ListConstruct(%83, %84), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %86 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %87 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %88 : int[] = prim::ListConstruct(%86, %87), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %89 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %90 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %91 : int[] = prim::ListConstruct(%89, %90), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %92 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %input.7 : Double(2, 192, 13, 13) = aten::max_pool2d(%input.6, %82, %85, %88, %91, %92), scope: AlexNet/Sequential[features]/MaxPool2d[5] | |
| %94 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %95 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %96 : int[] = prim::ListConstruct(%94, %95), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %97 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %98 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %99 : int[] = prim::ListConstruct(%97, %98), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %100 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %101 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %102 : int[] = prim::ListConstruct(%100, %101), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %103 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %104 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %105 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %106 : int[] = prim::ListConstruct(%104, %105), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %107 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %108 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %109 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %110 : bool = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %input.8 : Double(2, 384, 13, 13) = aten::_convolution(%input.7, %207, %206, %96, %99, %102, %103, %106, %107, %108, %109, %110), scope: AlexNet/Sequential[features]/Conv2d[6] | |
| %input.9 : Double(2, 384, 13, 13) = aten::relu_(%input.8), scope: AlexNet/Sequential[features]/ReLU[7] | |
| %113 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %114 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %115 : int[] = prim::ListConstruct(%113, %114), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %116 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %117 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %118 : int[] = prim::ListConstruct(%116, %117), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %119 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %120 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %121 : int[] = prim::ListConstruct(%119, %120), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %122 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %123 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %124 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %125 : int[] = prim::ListConstruct(%123, %124), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %126 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %127 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %128 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %129 : bool = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %input.10 : Double(2, 256, 13, 13) = aten::_convolution(%input.9, %205, %204, %115, %118, %121, %122, %125, %126, %127, %128, %129), scope: AlexNet/Sequential[features]/Conv2d[8] | |
| %input.11 : Double(2, 256, 13, 13) = aten::relu_(%input.10), scope: AlexNet/Sequential[features]/ReLU[9] | |
| %132 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %133 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %134 : int[] = prim::ListConstruct(%132, %133), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %135 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %136 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %137 : int[] = prim::ListConstruct(%135, %136), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %138 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %139 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %140 : int[] = prim::ListConstruct(%138, %139), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %141 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %142 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %143 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %144 : int[] = prim::ListConstruct(%142, %143), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %145 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %146 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %147 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %148 : bool = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %input.12 : Double(2, 256, 13, 13) = aten::_convolution(%input.11, %203, %202, %134, %137, %140, %141, %144, %145, %146, %147, %148), scope: AlexNet/Sequential[features]/Conv2d[10] | |
| %input.13 : Double(2, 256, 13, 13) = aten::relu_(%input.12), scope: AlexNet/Sequential[features]/ReLU[11] | |
| %151 : int = prim::Constant[value=3](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %152 : int = prim::Constant[value=3](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %153 : int[] = prim::ListConstruct(%151, %152), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %154 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %155 : int = prim::Constant[value=2](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %156 : int[] = prim::ListConstruct(%154, %155), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %157 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %158 : int = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %159 : int[] = prim::ListConstruct(%157, %158), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %160 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %161 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %162 : int[] = prim::ListConstruct(%160, %161), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %163 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %input.14 : Double(2, 256, 6, 6) = aten::max_pool2d(%input.13, %153, %156, %159, %162, %163), scope: AlexNet/Sequential[features]/MaxPool2d[12] | |
| %165 : int = prim::Constant[value=6](), scope: AlexNet/AdaptiveAvgPool2d[avgpool] | |
| %166 : int = prim::Constant[value=6](), scope: AlexNet/AdaptiveAvgPool2d[avgpool] | |
| %167 : int[] = prim::ListConstruct(%165, %166), scope: AlexNet/AdaptiveAvgPool2d[avgpool] | |
| %x : Double(2, 256, 6, 6) = aten::adaptive_avg_pool2d(%input.14, %167), scope: AlexNet/AdaptiveAvgPool2d[avgpool] | |
| %169 : int = prim::Constant[value=0](), scope: AlexNet | |
| %170 : int = aten::size(%x, %169), scope: AlexNet | |
| %171 : Long() = prim::NumToTensor(%170), scope: AlexNet | |
| %172 : int = prim::Int(%171), scope: AlexNet | |
| %173 : int = prim::Constant[value=9216](), scope: AlexNet | |
| %174 : int[] = prim::ListConstruct(%172, %173), scope: AlexNet | |
| %input.15 : Double(2, 9216) = aten::view(%x, %174), scope: AlexNet | |
| %176 : float = prim::Constant[value=0.5](), scope: AlexNet/Sequential[classifier]/Dropout[0] | |
| %177 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[classifier]/Dropout[0] | |
| %input.16 : Double(2, 9216) = aten::dropout(%input.15, %176, %177), scope: AlexNet/Sequential[classifier]/Dropout[0] | |
| %179 : Double(9216!, 4096!) = aten::t(%201), scope: AlexNet/Sequential[classifier]/Linear[1] | |
| %180 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[classifier]/Linear[1] | |
| %181 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[classifier]/Linear[1] | |
| %input.17 : Double(2, 4096) = aten::addmm(%200, %input.16, %179, %180, %181), scope: AlexNet/Sequential[classifier]/Linear[1] | |
| %input.18 : Double(2, 4096) = aten::relu_(%input.17), scope: AlexNet/Sequential[classifier]/ReLU[2] | |
| %184 : float = prim::Constant[value=0.5](), scope: AlexNet/Sequential[classifier]/Dropout[3] | |
| %185 : bool = prim::Constant[value=0](), scope: AlexNet/Sequential[classifier]/Dropout[3] | |
| %input.19 : Double(2, 4096) = aten::dropout(%input.18, %184, %185), scope: AlexNet/Sequential[classifier]/Dropout[3] | |
| %187 : Double(4096!, 4096!) = aten::t(%199), scope: AlexNet/Sequential[classifier]/Linear[4] | |
| %188 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[classifier]/Linear[4] | |
| %189 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[classifier]/Linear[4] | |
| %input.20 : Double(2, 4096) = aten::addmm(%198, %input.19, %187, %188, %189), scope: AlexNet/Sequential[classifier]/Linear[4] | |
| %input : Double(2, 4096) = aten::relu_(%input.20), scope: AlexNet/Sequential[classifier]/ReLU[5] | |
| %192 : Double(4096!, 1000!) = aten::t(%197), scope: AlexNet/Sequential[classifier]/Linear[6] | |
| %193 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[classifier]/Linear[6] | |
| %194 : int = prim::Constant[value=1](), scope: AlexNet/Sequential[classifier]/Linear[6] | |
| %195 : Double(2, 1000) = aten::addmm(%196, %input, %192, %193, %194), scope: AlexNet/Sequential[classifier]/Linear[6] | |
| return (%195) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment