models/rexnetv1.py (476 lines of code) (raw):

import torch import torch.nn import torch.functional import torch.nn.functional class rexnetv1(torch.nn.Module): def __init__(self): super().__init__() self.features_0 = torch.nn.modules.conv.Conv2d(3, 32, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), bias=False) self.features_1 = torch.nn.modules.batchnorm.BatchNorm2d(32) self.features_3_out_0 = torch.nn.modules.conv.Conv2d(32, 32, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=32, bias=False) self.features_3_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(32) self.features_3_out_2 = torch.nn.modules.activation.ReLU6() self.features_3_out_3 = torch.nn.modules.conv.Conv2d(32, 16, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_3_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(16) self.features_4_out_0 = torch.nn.modules.conv.Conv2d(16, 96, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_4_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(96) self.features_4_out_3 = torch.nn.modules.conv.Conv2d(96, 96, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), groups=96, bias=False) self.features_4_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(96) self.features_4_out_5 = torch.nn.modules.activation.ReLU6() self.features_4_out_6 = torch.nn.modules.conv.Conv2d(96, 27, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_4_out_7 = torch.nn.modules.batchnorm.BatchNorm2d(27) self.features_5_out_0 = torch.nn.modules.conv.Conv2d(27, 162, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_5_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(162) self.features_5_out_3 = torch.nn.modules.conv.Conv2d(162, 162, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=162, bias=False) self.features_5_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(162) self.features_5_out_5 = torch.nn.modules.activation.ReLU6() self.features_5_out_6 = torch.nn.modules.conv.Conv2d(162, 38, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_5_out_7 = torch.nn.modules.batchnorm.BatchNorm2d(38) self.features_6_out_0 = torch.nn.modules.conv.Conv2d(38, 228, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_6_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(228) self.features_6_out_3 = torch.nn.modules.conv.Conv2d(228, 228, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), groups=228, bias=False) self.features_6_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(228) self.features_6_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_6_out_5_fc_0 = torch.nn.modules.conv.Conv2d(228, 19, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_6_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(19) self.features_6_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_6_out_5_fc_3 = torch.nn.modules.conv.Conv2d(19, 228, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_6_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_6_out_6 = torch.nn.modules.activation.ReLU6() self.features_6_out_7 = torch.nn.modules.conv.Conv2d(228, 50, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_6_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(50) self.features_7_out_0 = torch.nn.modules.conv.Conv2d(50, 300, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_7_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(300) self.features_7_out_3 = torch.nn.modules.conv.Conv2d(300, 300, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=300, bias=False) self.features_7_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(300) self.features_7_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_7_out_5_fc_0 = torch.nn.modules.conv.Conv2d(300, 25, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_7_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(25) self.features_7_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_7_out_5_fc_3 = torch.nn.modules.conv.Conv2d(25, 300, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_7_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_7_out_6 = torch.nn.modules.activation.ReLU6() self.features_7_out_7 = torch.nn.modules.conv.Conv2d(300, 61, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_7_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(61) self.features_8_out_0 = torch.nn.modules.conv.Conv2d(61, 366, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_8_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(366) self.features_8_out_3 = torch.nn.modules.conv.Conv2d(366, 366, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), groups=366, bias=False) self.features_8_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(366) self.features_8_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_8_out_5_fc_0 = torch.nn.modules.conv.Conv2d(366, 30, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_8_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(30) self.features_8_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_8_out_5_fc_3 = torch.nn.modules.conv.Conv2d(30, 366, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_8_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_8_out_6 = torch.nn.modules.activation.ReLU6() self.features_8_out_7 = torch.nn.modules.conv.Conv2d(366, 72, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_8_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(72) self.features_9_out_0 = torch.nn.modules.conv.Conv2d(72, 432, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_9_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(432) self.features_9_out_3 = torch.nn.modules.conv.Conv2d(432, 432, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=432, bias=False) self.features_9_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(432) self.features_9_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_9_out_5_fc_0 = torch.nn.modules.conv.Conv2d(432, 36, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_9_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(36) self.features_9_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_9_out_5_fc_3 = torch.nn.modules.conv.Conv2d(36, 432, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_9_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_9_out_6 = torch.nn.modules.activation.ReLU6() self.features_9_out_7 = torch.nn.modules.conv.Conv2d(432, 84, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_9_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(84) self.features_10_out_0 = torch.nn.modules.conv.Conv2d(84, 504, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_10_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(504) self.features_10_out_3 = torch.nn.modules.conv.Conv2d(504, 504, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=504, bias=False) self.features_10_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(504) self.features_10_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_10_out_5_fc_0 = torch.nn.modules.conv.Conv2d(504, 42, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_10_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(42) self.features_10_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_10_out_5_fc_3 = torch.nn.modules.conv.Conv2d(42, 504, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_10_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_10_out_6 = torch.nn.modules.activation.ReLU6() self.features_10_out_7 = torch.nn.modules.conv.Conv2d(504, 95, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_10_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(95) self.features_11_out_0 = torch.nn.modules.conv.Conv2d(95, 570, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_11_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(570) self.features_11_out_3 = torch.nn.modules.conv.Conv2d(570, 570, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=570, bias=False) self.features_11_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(570) self.features_11_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_11_out_5_fc_0 = torch.nn.modules.conv.Conv2d(570, 47, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_11_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(47) self.features_11_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_11_out_5_fc_3 = torch.nn.modules.conv.Conv2d(47, 570, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_11_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_11_out_6 = torch.nn.modules.activation.ReLU6() self.features_11_out_7 = torch.nn.modules.conv.Conv2d(570, 106, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_11_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(106) self.features_12_out_0 = torch.nn.modules.conv.Conv2d(106, 636, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_12_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(636) self.features_12_out_3 = torch.nn.modules.conv.Conv2d(636, 636, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=636, bias=False) self.features_12_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(636) self.features_12_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_12_out_5_fc_0 = torch.nn.modules.conv.Conv2d(636, 53, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_12_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(53) self.features_12_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_12_out_5_fc_3 = torch.nn.modules.conv.Conv2d(53, 636, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_12_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_12_out_6 = torch.nn.modules.activation.ReLU6() self.features_12_out_7 = torch.nn.modules.conv.Conv2d(636, 117, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_12_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(117) self.features_13_out_0 = torch.nn.modules.conv.Conv2d(117, 702, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_13_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(702) self.features_13_out_3 = torch.nn.modules.conv.Conv2d(702, 702, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=702, bias=False) self.features_13_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(702) self.features_13_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_13_out_5_fc_0 = torch.nn.modules.conv.Conv2d(702, 58, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_13_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(58) self.features_13_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_13_out_5_fc_3 = torch.nn.modules.conv.Conv2d(58, 702, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_13_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_13_out_6 = torch.nn.modules.activation.ReLU6() self.features_13_out_7 = torch.nn.modules.conv.Conv2d(702, 128, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_13_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(128) self.features_14_out_0 = torch.nn.modules.conv.Conv2d(128, 768, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_14_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(768) self.features_14_out_3 = torch.nn.modules.conv.Conv2d(768, 768, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), groups=768, bias=False) self.features_14_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(768) self.features_14_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_14_out_5_fc_0 = torch.nn.modules.conv.Conv2d(768, 64, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_14_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(64) self.features_14_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_14_out_5_fc_3 = torch.nn.modules.conv.Conv2d(64, 768, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_14_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_14_out_6 = torch.nn.modules.activation.ReLU6() self.features_14_out_7 = torch.nn.modules.conv.Conv2d(768, 140, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_14_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(140) self.features_15_out_0 = torch.nn.modules.conv.Conv2d(140, 840, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_15_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(840) self.features_15_out_3 = torch.nn.modules.conv.Conv2d(840, 840, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=840, bias=False) self.features_15_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(840) self.features_15_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_15_out_5_fc_0 = torch.nn.modules.conv.Conv2d(840, 70, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_15_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(70) self.features_15_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_15_out_5_fc_3 = torch.nn.modules.conv.Conv2d(70, 840, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_15_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_15_out_6 = torch.nn.modules.activation.ReLU6() self.features_15_out_7 = torch.nn.modules.conv.Conv2d(840, 151, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_15_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(151) self.features_16_out_0 = torch.nn.modules.conv.Conv2d(151, 906, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_16_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(906) self.features_16_out_3 = torch.nn.modules.conv.Conv2d(906, 906, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=906, bias=False) self.features_16_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(906) self.features_16_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_16_out_5_fc_0 = torch.nn.modules.conv.Conv2d(906, 75, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_16_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(75) self.features_16_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_16_out_5_fc_3 = torch.nn.modules.conv.Conv2d(75, 906, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_16_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_16_out_6 = torch.nn.modules.activation.ReLU6() self.features_16_out_7 = torch.nn.modules.conv.Conv2d(906, 162, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_16_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(162) self.features_17_out_0 = torch.nn.modules.conv.Conv2d(162, 972, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_17_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(972) self.features_17_out_3 = torch.nn.modules.conv.Conv2d(972, 972, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=972, bias=False) self.features_17_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(972) self.features_17_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_17_out_5_fc_0 = torch.nn.modules.conv.Conv2d(972, 81, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_17_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(81) self.features_17_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_17_out_5_fc_3 = torch.nn.modules.conv.Conv2d(81, 972, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_17_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_17_out_6 = torch.nn.modules.activation.ReLU6() self.features_17_out_7 = torch.nn.modules.conv.Conv2d(972, 174, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_17_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(174) self.features_18_out_0 = torch.nn.modules.conv.Conv2d(174, 1044, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_18_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(1044) self.features_18_out_3 = torch.nn.modules.conv.Conv2d(1044, 1044, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=1044, bias=False) self.features_18_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(1044) self.features_18_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.features_18_out_5_fc_0 = torch.nn.modules.conv.Conv2d(1044, 87, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_18_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(87) self.features_18_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True) self.features_18_out_5_fc_3 = torch.nn.modules.conv.Conv2d(87, 1044, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) self.features_18_out_5_fc_4 = torch.nn.modules.activation.Sigmoid() self.features_18_out_6 = torch.nn.modules.activation.ReLU6() self.features_18_out_7 = torch.nn.modules.conv.Conv2d(1044, 185, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_18_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(185) self.features_19 = torch.nn.modules.conv.Conv2d(185, 1280, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False) self.features_20 = torch.nn.modules.batchnorm.BatchNorm2d(1280) self.features_22 = torch.nn.modules.pooling.AdaptiveAvgPool2d(1) self.output_0 = torch.nn.modules.dropout.Dropout(p=0.2) self.output_1 = torch.nn.modules.conv.Conv2d(1280, 1000, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1)) def forward(self, input_1): features_0 = self.features_0(input_1) features_1 = self.features_1(features_0) sigmoid_1 = features_1.sigmoid() mul_1 = features_1.mul_(sigmoid_1) features_3_out_0 = self.features_3_out_0(mul_1) features_3_out_1 = self.features_3_out_1(features_3_out_0) features_3_out_2 = self.features_3_out_2(features_3_out_1) features_3_out_3 = self.features_3_out_3(features_3_out_2) features_3_out_4 = self.features_3_out_4(features_3_out_3) features_4_out_0 = self.features_4_out_0(features_3_out_4) features_4_out_1 = self.features_4_out_1(features_4_out_0) sigmoid_2 = features_4_out_1.sigmoid() mul_2 = features_4_out_1.mul_(sigmoid_2) features_4_out_3 = self.features_4_out_3(mul_2) features_4_out_4 = self.features_4_out_4(features_4_out_3) features_4_out_5 = self.features_4_out_5(features_4_out_4) features_4_out_6 = self.features_4_out_6(features_4_out_5) features_4_out_7 = self.features_4_out_7(features_4_out_6) features_5_out_0 = self.features_5_out_0(features_4_out_7) features_5_out_1 = self.features_5_out_1(features_5_out_0) sigmoid_3 = features_5_out_1.sigmoid() mul_3 = features_5_out_1.mul_(sigmoid_3) features_5_out_3 = self.features_5_out_3(mul_3) features_5_out_4 = self.features_5_out_4(features_5_out_3) features_5_out_5 = self.features_5_out_5(features_5_out_4) features_5_out_6 = self.features_5_out_6(features_5_out_5) features_5_out_7 = self.features_5_out_7(features_5_out_6) getitem_1 = features_5_out_7[:, 0:27] add_1 = getitem_1.__iadd__(features_4_out_7) features_6_out_0 = self.features_6_out_0(features_5_out_7) features_6_out_1 = self.features_6_out_1(features_6_out_0) sigmoid_4 = features_6_out_1.sigmoid() mul_4 = features_6_out_1.mul_(sigmoid_4) features_6_out_3 = self.features_6_out_3(mul_4) features_6_out_4 = self.features_6_out_4(features_6_out_3) features_6_out_5_avg_pool = self.features_6_out_5_avg_pool(features_6_out_4) features_6_out_5_fc_0 = self.features_6_out_5_fc_0(features_6_out_5_avg_pool) features_6_out_5_fc_1 = self.features_6_out_5_fc_1(features_6_out_5_fc_0) features_6_out_5_fc_2 = self.features_6_out_5_fc_2(features_6_out_5_fc_1) features_6_out_5_fc_3 = self.features_6_out_5_fc_3(features_6_out_5_fc_2) features_6_out_5_fc_4 = self.features_6_out_5_fc_4(features_6_out_5_fc_3) mul_5 = features_6_out_4.__mul__(features_6_out_5_fc_4) features_6_out_6 = self.features_6_out_6(mul_5) features_6_out_7 = self.features_6_out_7(features_6_out_6) features_6_out_8 = self.features_6_out_8(features_6_out_7) features_7_out_0 = self.features_7_out_0(features_6_out_8) features_7_out_1 = self.features_7_out_1(features_7_out_0) sigmoid_5 = features_7_out_1.sigmoid() mul_6 = features_7_out_1.mul_(sigmoid_5) features_7_out_3 = self.features_7_out_3(mul_6) features_7_out_4 = self.features_7_out_4(features_7_out_3) features_7_out_5_avg_pool = self.features_7_out_5_avg_pool(features_7_out_4) features_7_out_5_fc_0 = self.features_7_out_5_fc_0(features_7_out_5_avg_pool) features_7_out_5_fc_1 = self.features_7_out_5_fc_1(features_7_out_5_fc_0) features_7_out_5_fc_2 = self.features_7_out_5_fc_2(features_7_out_5_fc_1) features_7_out_5_fc_3 = self.features_7_out_5_fc_3(features_7_out_5_fc_2) features_7_out_5_fc_4 = self.features_7_out_5_fc_4(features_7_out_5_fc_3) mul_7 = features_7_out_4.__mul__(features_7_out_5_fc_4) features_7_out_6 = self.features_7_out_6(mul_7) features_7_out_7 = self.features_7_out_7(features_7_out_6) features_7_out_8 = self.features_7_out_8(features_7_out_7) getitem_2 = features_7_out_8[:, 0:50] add_2 = getitem_2.__iadd__(features_6_out_8) features_8_out_0 = self.features_8_out_0(features_7_out_8) features_8_out_1 = self.features_8_out_1(features_8_out_0) sigmoid_6 = features_8_out_1.sigmoid() mul_8 = features_8_out_1.mul_(sigmoid_6) features_8_out_3 = self.features_8_out_3(mul_8) features_8_out_4 = self.features_8_out_4(features_8_out_3) features_8_out_5_avg_pool = self.features_8_out_5_avg_pool(features_8_out_4) features_8_out_5_fc_0 = self.features_8_out_5_fc_0(features_8_out_5_avg_pool) features_8_out_5_fc_1 = self.features_8_out_5_fc_1(features_8_out_5_fc_0) features_8_out_5_fc_2 = self.features_8_out_5_fc_2(features_8_out_5_fc_1) features_8_out_5_fc_3 = self.features_8_out_5_fc_3(features_8_out_5_fc_2) features_8_out_5_fc_4 = self.features_8_out_5_fc_4(features_8_out_5_fc_3) mul_9 = features_8_out_4.__mul__(features_8_out_5_fc_4) features_8_out_6 = self.features_8_out_6(mul_9) features_8_out_7 = self.features_8_out_7(features_8_out_6) features_8_out_8 = self.features_8_out_8(features_8_out_7) features_9_out_0 = self.features_9_out_0(features_8_out_8) features_9_out_1 = self.features_9_out_1(features_9_out_0) sigmoid_7 = features_9_out_1.sigmoid() mul_10 = features_9_out_1.mul_(sigmoid_7) features_9_out_3 = self.features_9_out_3(mul_10) features_9_out_4 = self.features_9_out_4(features_9_out_3) features_9_out_5_avg_pool = self.features_9_out_5_avg_pool(features_9_out_4) features_9_out_5_fc_0 = self.features_9_out_5_fc_0(features_9_out_5_avg_pool) features_9_out_5_fc_1 = self.features_9_out_5_fc_1(features_9_out_5_fc_0) features_9_out_5_fc_2 = self.features_9_out_5_fc_2(features_9_out_5_fc_1) features_9_out_5_fc_3 = self.features_9_out_5_fc_3(features_9_out_5_fc_2) features_9_out_5_fc_4 = self.features_9_out_5_fc_4(features_9_out_5_fc_3) mul_11 = features_9_out_4.__mul__(features_9_out_5_fc_4) features_9_out_6 = self.features_9_out_6(mul_11) features_9_out_7 = self.features_9_out_7(features_9_out_6) features_9_out_8 = self.features_9_out_8(features_9_out_7) getitem_3 = features_9_out_8[:, 0:72] add_3 = getitem_3.__iadd__(features_8_out_8) features_10_out_0 = self.features_10_out_0(features_9_out_8) features_10_out_1 = self.features_10_out_1(features_10_out_0) sigmoid_8 = features_10_out_1.sigmoid() mul_12 = features_10_out_1.mul_(sigmoid_8) features_10_out_3 = self.features_10_out_3(mul_12) features_10_out_4 = self.features_10_out_4(features_10_out_3) features_10_out_5_avg_pool = self.features_10_out_5_avg_pool(features_10_out_4) features_10_out_5_fc_0 = self.features_10_out_5_fc_0(features_10_out_5_avg_pool) features_10_out_5_fc_1 = self.features_10_out_5_fc_1(features_10_out_5_fc_0) features_10_out_5_fc_2 = self.features_10_out_5_fc_2(features_10_out_5_fc_1) features_10_out_5_fc_3 = self.features_10_out_5_fc_3(features_10_out_5_fc_2) features_10_out_5_fc_4 = self.features_10_out_5_fc_4(features_10_out_5_fc_3) mul_13 = features_10_out_4.__mul__(features_10_out_5_fc_4) features_10_out_6 = self.features_10_out_6(mul_13) features_10_out_7 = self.features_10_out_7(features_10_out_6) features_10_out_8 = self.features_10_out_8(features_10_out_7) getitem_4 = features_10_out_8[:, 0:84] add_4 = getitem_4.__iadd__(features_9_out_8) features_11_out_0 = self.features_11_out_0(features_10_out_8) features_11_out_1 = self.features_11_out_1(features_11_out_0) sigmoid_9 = features_11_out_1.sigmoid() mul_14 = features_11_out_1.mul_(sigmoid_9) features_11_out_3 = self.features_11_out_3(mul_14) features_11_out_4 = self.features_11_out_4(features_11_out_3) features_11_out_5_avg_pool = self.features_11_out_5_avg_pool(features_11_out_4) features_11_out_5_fc_0 = self.features_11_out_5_fc_0(features_11_out_5_avg_pool) features_11_out_5_fc_1 = self.features_11_out_5_fc_1(features_11_out_5_fc_0) features_11_out_5_fc_2 = self.features_11_out_5_fc_2(features_11_out_5_fc_1) features_11_out_5_fc_3 = self.features_11_out_5_fc_3(features_11_out_5_fc_2) features_11_out_5_fc_4 = self.features_11_out_5_fc_4(features_11_out_5_fc_3) mul_15 = features_11_out_4.__mul__(features_11_out_5_fc_4) features_11_out_6 = self.features_11_out_6(mul_15) features_11_out_7 = self.features_11_out_7(features_11_out_6) features_11_out_8 = self.features_11_out_8(features_11_out_7) getitem_5 = features_11_out_8[:, 0:95] add_5 = getitem_5.__iadd__(features_10_out_8) features_12_out_0 = self.features_12_out_0(features_11_out_8) features_12_out_1 = self.features_12_out_1(features_12_out_0) sigmoid_10 = features_12_out_1.sigmoid() mul_16 = features_12_out_1.mul_(sigmoid_10) features_12_out_3 = self.features_12_out_3(mul_16) features_12_out_4 = self.features_12_out_4(features_12_out_3) features_12_out_5_avg_pool = self.features_12_out_5_avg_pool(features_12_out_4) features_12_out_5_fc_0 = self.features_12_out_5_fc_0(features_12_out_5_avg_pool) features_12_out_5_fc_1 = self.features_12_out_5_fc_1(features_12_out_5_fc_0) features_12_out_5_fc_2 = self.features_12_out_5_fc_2(features_12_out_5_fc_1) features_12_out_5_fc_3 = self.features_12_out_5_fc_3(features_12_out_5_fc_2) features_12_out_5_fc_4 = self.features_12_out_5_fc_4(features_12_out_5_fc_3) mul_17 = features_12_out_4.__mul__(features_12_out_5_fc_4) features_12_out_6 = self.features_12_out_6(mul_17) features_12_out_7 = self.features_12_out_7(features_12_out_6) features_12_out_8 = self.features_12_out_8(features_12_out_7) getitem_6 = features_12_out_8[:, 0:106] add_6 = getitem_6.__iadd__(features_11_out_8) features_13_out_0 = self.features_13_out_0(features_12_out_8) features_13_out_1 = self.features_13_out_1(features_13_out_0) sigmoid_11 = features_13_out_1.sigmoid() mul_18 = features_13_out_1.mul_(sigmoid_11) features_13_out_3 = self.features_13_out_3(mul_18) features_13_out_4 = self.features_13_out_4(features_13_out_3) features_13_out_5_avg_pool = self.features_13_out_5_avg_pool(features_13_out_4) features_13_out_5_fc_0 = self.features_13_out_5_fc_0(features_13_out_5_avg_pool) features_13_out_5_fc_1 = self.features_13_out_5_fc_1(features_13_out_5_fc_0) features_13_out_5_fc_2 = self.features_13_out_5_fc_2(features_13_out_5_fc_1) features_13_out_5_fc_3 = self.features_13_out_5_fc_3(features_13_out_5_fc_2) features_13_out_5_fc_4 = self.features_13_out_5_fc_4(features_13_out_5_fc_3) mul_19 = features_13_out_4.__mul__(features_13_out_5_fc_4) features_13_out_6 = self.features_13_out_6(mul_19) features_13_out_7 = self.features_13_out_7(features_13_out_6) features_13_out_8 = self.features_13_out_8(features_13_out_7) getitem_7 = features_13_out_8[:, 0:117] add_7 = getitem_7.__iadd__(features_12_out_8) features_14_out_0 = self.features_14_out_0(features_13_out_8) features_14_out_1 = self.features_14_out_1(features_14_out_0) sigmoid_12 = features_14_out_1.sigmoid() mul_20 = features_14_out_1.mul_(sigmoid_12) features_14_out_3 = self.features_14_out_3(mul_20) features_14_out_4 = self.features_14_out_4(features_14_out_3) features_14_out_5_avg_pool = self.features_14_out_5_avg_pool(features_14_out_4) features_14_out_5_fc_0 = self.features_14_out_5_fc_0(features_14_out_5_avg_pool) features_14_out_5_fc_1 = self.features_14_out_5_fc_1(features_14_out_5_fc_0) features_14_out_5_fc_2 = self.features_14_out_5_fc_2(features_14_out_5_fc_1) features_14_out_5_fc_3 = self.features_14_out_5_fc_3(features_14_out_5_fc_2) features_14_out_5_fc_4 = self.features_14_out_5_fc_4(features_14_out_5_fc_3) mul_21 = features_14_out_4.__mul__(features_14_out_5_fc_4) features_14_out_6 = self.features_14_out_6(mul_21) features_14_out_7 = self.features_14_out_7(features_14_out_6) features_14_out_8 = self.features_14_out_8(features_14_out_7) features_15_out_0 = self.features_15_out_0(features_14_out_8) features_15_out_1 = self.features_15_out_1(features_15_out_0) sigmoid_13 = features_15_out_1.sigmoid() mul_22 = features_15_out_1.mul_(sigmoid_13) features_15_out_3 = self.features_15_out_3(mul_22) features_15_out_4 = self.features_15_out_4(features_15_out_3) features_15_out_5_avg_pool = self.features_15_out_5_avg_pool(features_15_out_4) features_15_out_5_fc_0 = self.features_15_out_5_fc_0(features_15_out_5_avg_pool) features_15_out_5_fc_1 = self.features_15_out_5_fc_1(features_15_out_5_fc_0) features_15_out_5_fc_2 = self.features_15_out_5_fc_2(features_15_out_5_fc_1) features_15_out_5_fc_3 = self.features_15_out_5_fc_3(features_15_out_5_fc_2) features_15_out_5_fc_4 = self.features_15_out_5_fc_4(features_15_out_5_fc_3) mul_23 = features_15_out_4.__mul__(features_15_out_5_fc_4) features_15_out_6 = self.features_15_out_6(mul_23) features_15_out_7 = self.features_15_out_7(features_15_out_6) features_15_out_8 = self.features_15_out_8(features_15_out_7) getitem_8 = features_15_out_8[:, 0:140] add_8 = getitem_8.__iadd__(features_14_out_8) features_16_out_0 = self.features_16_out_0(features_15_out_8) features_16_out_1 = self.features_16_out_1(features_16_out_0) sigmoid_14 = features_16_out_1.sigmoid() mul_24 = features_16_out_1.mul_(sigmoid_14) features_16_out_3 = self.features_16_out_3(mul_24) features_16_out_4 = self.features_16_out_4(features_16_out_3) features_16_out_5_avg_pool = self.features_16_out_5_avg_pool(features_16_out_4) features_16_out_5_fc_0 = self.features_16_out_5_fc_0(features_16_out_5_avg_pool) features_16_out_5_fc_1 = self.features_16_out_5_fc_1(features_16_out_5_fc_0) features_16_out_5_fc_2 = self.features_16_out_5_fc_2(features_16_out_5_fc_1) features_16_out_5_fc_3 = self.features_16_out_5_fc_3(features_16_out_5_fc_2) features_16_out_5_fc_4 = self.features_16_out_5_fc_4(features_16_out_5_fc_3) mul_25 = features_16_out_4.__mul__(features_16_out_5_fc_4) features_16_out_6 = self.features_16_out_6(mul_25) features_16_out_7 = self.features_16_out_7(features_16_out_6) features_16_out_8 = self.features_16_out_8(features_16_out_7) getitem_9 = features_16_out_8[:, 0:151] add_9 = getitem_9.__iadd__(features_15_out_8) features_17_out_0 = self.features_17_out_0(features_16_out_8) features_17_out_1 = self.features_17_out_1(features_17_out_0) sigmoid_15 = features_17_out_1.sigmoid() mul_26 = features_17_out_1.mul_(sigmoid_15) features_17_out_3 = self.features_17_out_3(mul_26) features_17_out_4 = self.features_17_out_4(features_17_out_3) features_17_out_5_avg_pool = self.features_17_out_5_avg_pool(features_17_out_4) features_17_out_5_fc_0 = self.features_17_out_5_fc_0(features_17_out_5_avg_pool) features_17_out_5_fc_1 = self.features_17_out_5_fc_1(features_17_out_5_fc_0) features_17_out_5_fc_2 = self.features_17_out_5_fc_2(features_17_out_5_fc_1) features_17_out_5_fc_3 = self.features_17_out_5_fc_3(features_17_out_5_fc_2) features_17_out_5_fc_4 = self.features_17_out_5_fc_4(features_17_out_5_fc_3) mul_27 = features_17_out_4.__mul__(features_17_out_5_fc_4) features_17_out_6 = self.features_17_out_6(mul_27) features_17_out_7 = self.features_17_out_7(features_17_out_6) features_17_out_8 = self.features_17_out_8(features_17_out_7) getitem_10 = features_17_out_8[:, 0:162] add_10 = getitem_10.__iadd__(features_16_out_8) features_18_out_0 = self.features_18_out_0(features_17_out_8) features_18_out_1 = self.features_18_out_1(features_18_out_0) sigmoid_16 = features_18_out_1.sigmoid() mul_28 = features_18_out_1.mul_(sigmoid_16) features_18_out_3 = self.features_18_out_3(mul_28) features_18_out_4 = self.features_18_out_4(features_18_out_3) features_18_out_5_avg_pool = self.features_18_out_5_avg_pool(features_18_out_4) features_18_out_5_fc_0 = self.features_18_out_5_fc_0(features_18_out_5_avg_pool) features_18_out_5_fc_1 = self.features_18_out_5_fc_1(features_18_out_5_fc_0) features_18_out_5_fc_2 = self.features_18_out_5_fc_2(features_18_out_5_fc_1) features_18_out_5_fc_3 = self.features_18_out_5_fc_3(features_18_out_5_fc_2) features_18_out_5_fc_4 = self.features_18_out_5_fc_4(features_18_out_5_fc_3) mul_29 = features_18_out_4.__mul__(features_18_out_5_fc_4) features_18_out_6 = self.features_18_out_6(mul_29) features_18_out_7 = self.features_18_out_7(features_18_out_6) features_18_out_8 = self.features_18_out_8(features_18_out_7) getitem_11 = features_18_out_8[:, 0:174] add_11 = getitem_11.__iadd__(features_17_out_8) features_19 = self.features_19(features_18_out_8) features_20 = self.features_20(features_19) sigmoid_17 = features_20.sigmoid() mul_30 = features_20.mul_(sigmoid_17) features_22 = self.features_22(mul_30) output_0 = self.output_0(features_22) output_1 = self.output_1(output_0) flatten_1 = output_1.flatten(1) return flatten_1 if __name__ == "__main__": model = rexnetv1() model.eval() model.cpu() dummy_input_0 = torch.ones((2, 3, 224, 224), dtype=torch.float32) output = model(dummy_input_0) print(output)