=================== FORWARD TORCH GRAPH =================== graph(%x.5 : Long(1, 3), %input.3 : Long(1, 3), %weight.1 : Float(16, 10), %3 : Float(1, 512, 10), %weight.2 : Float(3, 10), %weight.3 : Float(10, 10), %bias.1 : Float(10), %weight.4 : Float(10, 10), %bias.2 : Float(10), %weight.5 : Float(10, 10), %bias.3 : Float(10), %weight.6 : Float(10, 10), %bias.4 : Float(10), %weight.7 : Float(40, 10), %bias.5 : Float(40), %weight : Float(10, 40), %bias : Float(10), %17 : Float(10), %18 : Float(10), %19 : Float(10), %20 : Float(10)): %21 : int = prim::Constant[value=0](), scope: BERT/BERTEmbedding[embedding]/TokenEmbedding[token] %22 : bool = prim::Constant[value=0](), scope: BERT/BERTEmbedding[embedding]/TokenEmbedding[token] %24 : Float(1, 3, 10) = aten::embedding(%weight.1, %x.5, %21, %22, %22), scope: BERT/BERTEmbedding[embedding]/TokenEmbedding[token] %1909 : int[] = aten::size(%weight.1) %weight_size_0.4 : int = aten::select(%1909, %21) %27 : int = prim::Constant[value=9223372036854775807](), scope: BERT/BERTEmbedding[embedding]/PositionalEmbedding[position] %28 : int = prim::Constant[value=1](), scope: BERT/BERTEmbedding[embedding]/PositionalEmbedding[position] %29 : Float(1, 512, 10) = aten::slice(%3, %21, %21, %27, %28), scope: BERT/BERTEmbedding[embedding]/PositionalEmbedding[position] %32 : int = prim::Constant[value=3](), scope: BERT/BERTEmbedding[embedding]/PositionalEmbedding[position] %34 : Float(1!, 3, 10) = aten::slice(%29, %28, %21, %32, %28), scope: BERT/BERTEmbedding[embedding]/PositionalEmbedding[position] %1901 : int[] = aten::size(%24) %36 : Float(1, 3, 10) = aten::add(%24, %34, %28), scope: BERT/BERTEmbedding[embedding] %40 : Float(1, 3, 10) = aten::embedding(%weight.2, %input.3, %21, %22, %22), scope: BERT/BERTEmbedding[embedding]/SegmentEmbedding[segment] %1881 : int[] = aten::size(%weight.2) %weight_size_0.2 : int = aten::select(%1881, %21) %1873 : int[] = aten::size(%36) %1876 : int[] = aten::size(%40) %input.9 : Float(1, 3, 10) = aten::add(%36, %40, %28), scope: BERT/BERTEmbedding[embedding] %43 : float = prim::Constant[value=0.1](), scope: BERT/BERTEmbedding[embedding]/Dropout[dropout] %44 : bool = prim::Constant[value=1](), scope: BERT/BERTEmbedding[embedding]/Dropout[dropout] %1837 : Generator? = prim::Constant() %1838 : float = prim::Constant[value=1]() %use_cuda.12 : bool = prim::is_cuda(%input.9) %p1m.12 : float = aten::sub(%1838, %43) %mask.24 : Tensor, %res.18 : Float(1, 3, 10) = prim::If(%use_cuda.12) block0(): %1843 : Tensor = aten::rand_like(%input.9) %mask.1 : Tensor = aten::lt(%1843, %p1m.12) %1845 : Tensor = aten::type_as(%mask.1, %input.9) %1846 : Tensor = aten::mul(%1845, %input.9) %1847 : float = aten::div(%1838, %p1m.12) %res.1 : Tensor = aten::mul(%1846, %1847) -> (%mask.1, %res.1) block1(): %mask.2 : Tensor = aten::empty_like(%input.9) %1850 : Tensor = aten::bernoulli_(%mask.2, %p1m.12, %1837) %1851 : Tensor = aten::mul(%mask.2, %input.9) %res.2 : Tensor = aten::div(%1851, %p1m.12) -> (%mask.2, %res.2) %47 : int = aten::size(%res.18, %21), scope: BERT/SublayerConnection %batch_size : Long() = prim::NumToTensor(%47), scope: BERT/SublayerConnection %49 : int = prim::Int(%batch_size), scope: BERT/SublayerConnection %53 : Float(10!, 10!) = aten::t(%weight.3), scope: BERT/SublayerConnection/Linear %output.1 : Float(1, 3, 10) = aten::matmul(%res.18, %53), scope: BERT/SublayerConnection/Linear %1720 : int[] = aten::size(%output.1) %1723 : int[] = aten::size(%bias.1) %56 : Float(1, 3, 10) = aten::add(%output.1, %bias.1, %28) %57 : int = prim::Constant[value=-1](), scope: BERT/SublayerConnection %58 : int = prim::Constant[value=2](), scope: BERT/SublayerConnection %59 : int = prim::Constant[value=5](), scope: BERT/SublayerConnection %60 : int[] = prim::ListConstruct(%49, %57, %58, %59), scope: BERT/SublayerConnection %61 : Float(1, 3, 2, 5) = aten::view(%56, %60), scope: BERT/SublayerConnection %self_size.21 : int[] = aten::size(%56) %query.1 : Float(1!, 2!, 3!, 5) = aten::transpose(%61, %28, %58), scope: BERT/SublayerConnection %65 : Float(10!, 10!) = aten::t(%weight.4), scope: BERT/SublayerConnection/Linear %output.2 : Float(1, 3, 10) = aten::matmul(%res.18, %65), scope: BERT/SublayerConnection/Linear %1578 : int[] = aten::size(%output.2) %1581 : int[] = aten::size(%bias.2) %68 : Float(1, 3, 10) = aten::add(%output.2, %bias.2, %28) %73 : Float(1, 3, 2, 5) = aten::view(%68, %60), scope: BERT/SublayerConnection %self_size.18 : int[] = aten::size(%68) %key : Float(1!, 2!, 3!, 5) = aten::transpose(%73, %28, %58), scope: BERT/SublayerConnection %77 : Float(10!, 10!) = aten::t(%weight.5), scope: BERT/SublayerConnection/Linear %output.3 : Float(1, 3, 10) = aten::matmul(%res.18, %77), scope: BERT/SublayerConnection/Linear %1436 : int[] = aten::size(%output.3) %1439 : int[] = aten::size(%bias.3) %80 : Float(1, 3, 10) = aten::add(%output.3, %bias.3, %28) %85 : Float(1, 3, 2, 5) = aten::view(%80, %60), scope: BERT/SublayerConnection %self_size.15 : int[] = aten::size(%80) %value.1 : Float(1!, 2!, 3!, 5) = aten::transpose(%85, %28, %58), scope: BERT/SublayerConnection %89 : int = prim::Constant[value=-2](), scope: BERT/SublayerConnection/Attention %91 : Float(1!, 2, 5!, 3!) = aten::transpose(%key, %89, %57), scope: BERT/SublayerConnection/Attention %92 : Float(1, 2, 3, 3) = aten::matmul(%query.1, %91), scope: BERT/SublayerConnection/Attention %93 : float = prim::Constant[value=2.23607]() %94 : Tensor = aten::div(%92, %93) %input.11 : Float(1, 2, 3, 3) = aten::softmax(%94, %57), scope: BERT/SublayerConnection/Attention %use_cuda.10 : bool = prim::is_cuda(%input.11) %mask.20 : Tensor, %res.19 : Float(1, 2, 3, 3) = prim::If(%use_cuda.10) block0(): %1251 : Tensor = aten::rand_like(%input.11) %mask.21 : Tensor = aten::lt(%1251, %p1m.12) %1253 : Tensor = aten::type_as(%mask.21, %input.11) %1254 : Tensor = aten::mul(%1253, %input.11) %1255 : float = aten::div(%1838, %p1m.12) %res.16 : Tensor = aten::mul(%1254, %1255) -> (%mask.21, %res.16) block1(): %mask.22 : Tensor = aten::empty_like(%input.11) %1258 : Tensor = aten::bernoulli_(%mask.22, %p1m.12, %1837) %1259 : Tensor = aten::mul(%mask.22, %input.11) %res.17 : Tensor = aten::div(%1259, %p1m.12) -> (%mask.22, %res.17) %x.2 : Float(1, 2, 3, 5) = aten::matmul(%res.19, %value.1), scope: BERT/SublayerConnection/Attention %103 : Float(1!, 3!, 2!, 5) = aten::transpose(%x.2, %28, %58), scope: BERT/SublayerConnection %104 : Float(1, 3, 2, 5) = aten::contiguous(%103), scope: BERT/SublayerConnection %106 : int = prim::Constant[value=10](), scope: BERT/SublayerConnection %107 : int[] = prim::ListConstruct(%49, %57, %106), scope: BERT/SublayerConnection %input.12 : Float(1, 3, 10) = aten::view(%104, %107), scope: BERT/SublayerConnection %self_size.11 : int[] = aten::size(%104) %109 : Float(10!, 10!) = aten::t(%weight.6), scope: BERT/SublayerConnection/Linear %output.4 : Float(1, 3, 10) = aten::matmul(%input.12, %109), scope: BERT/SublayerConnection/Linear %995 : int[] = aten::size(%output.4) %998 : int[] = aten::size(%bias.4) %x.6 : Float(1, 3, 10) = aten::add(%output.4, %bias.4, %28) %114 : int[] = prim::ListConstruct(%57), scope: BERT/SublayerConnection/LayerNorm[norm] %mean.1 : Float(1, 3, 1) = aten::mean(%x.6, %114, %44), scope: BERT/SublayerConnection/LayerNorm[norm] %self_size.8 : int[] = aten::size(%x.6) %std.2 : Float(1, 3, 1) = aten::std(%x.6, %114, %44, %44), scope: BERT/SublayerConnection/LayerNorm[norm] %862 : int[] = aten::size(%mean.1) %123 : Float(1, 3, 10) = aten::sub(%x.6, %mean.1, %28), scope: BERT/SublayerConnection/LayerNorm[norm] %124 : Float(1, 3, 10) = aten::mul(%17, %123), scope: BERT/SublayerConnection/LayerNorm[norm] %126 : float = prim::Constant[value=1e-06]() %127 : Tensor = aten::add(%std.2, %126, %28) %128 : Float(1, 3, 10) = aten::div(%124, %127), scope: BERT/SublayerConnection/LayerNorm[norm] %823 : int[] = aten::size(%128) %826 : int[] = aten::size(%18) %input.13 : Float(1, 3, 10) = aten::add(%128, %18, %28), scope: BERT/SublayerConnection/LayerNorm[norm] %use_cuda.8 : bool = prim::is_cuda(%input.13) %mask.16 : Tensor, %res.12 : Float(1, 3, 10) = prim::If(%use_cuda.8) block0(): %793 : Tensor = aten::rand_like(%input.13) %mask.17 : Tensor = aten::lt(%793, %p1m.12) %795 : Tensor = aten::type_as(%mask.17, %input.13) %796 : Tensor = aten::mul(%795, %input.13) %797 : float = aten::div(%1838, %p1m.12) %res.13 : Tensor = aten::mul(%796, %797) -> (%mask.17, %res.13) block1(): %mask.18 : Tensor = aten::empty_like(%input.13) %800 : Tensor = aten::bernoulli_(%mask.18, %p1m.12, %1837) %801 : Tensor = aten::mul(%mask.18, %input.13) %res.14 : Tensor = aten::div(%801, %p1m.12) -> (%mask.18, %res.14) %783 : int[] = aten::size(%res.12) %input.14 : Float(1, 3, 10) = aten::add(%res.18, %res.12, %28), scope: BERT/SublayerConnection %136 : Float(10!, 40!) = aten::t(%weight.7), scope: BERT/SublayerConnection/PositionwiseFeedForward/Linear[w_1] %output.5 : Float(1, 3, 40) = aten::matmul(%input.14, %136), scope: BERT/SublayerConnection/PositionwiseFeedForward/Linear[w_1] %663 : int[] = aten::size(%output.5) %666 : int[] = aten::size(%bias.5) %x.7 : Float(1, 3, 40) = aten::add(%output.5, %bias.5, %28) %140 : float = prim::Constant[value=0.5]() %141 : Tensor = aten::mul(%x.7, %140) %143 : Float(1, 3, 40) = aten::pow(%x.7, %32), scope: BERT/SublayerConnection/PositionwiseFeedForward/GELU[activation] %144 : float = prim::Constant[value=0.044715]() %145 : Tensor = aten::mul(%143, %144) %628 : int[] = aten::size(%145) %147 : Float(1, 3, 40) = aten::add(%x.7, %145, %28), scope: BERT/SublayerConnection/PositionwiseFeedForward/GELU[activation] %148 : float = prim::Constant[value=0.797885]() %149 : Tensor = aten::mul(%147, %148) %150 : Float(1, 3, 40) = aten::tanh(%149), scope: BERT/SublayerConnection/PositionwiseFeedForward/GELU[activation] %153 : Tensor = aten::add(%150, %28, %28) %input.15 : Float(1, 3, 40) = aten::mul(%141, %153), scope: BERT/SublayerConnection/PositionwiseFeedForward/GELU[activation] %use_cuda.6 : bool = prim::is_cuda(%input.15) %mask.12 : Tensor, %res.20 : Float(1, 3, 40) = prim::If(%use_cuda.6) block0(): %562 : Tensor = aten::rand_like(%input.15) %mask.13 : Tensor = aten::lt(%562, %p1m.12) %564 : Tensor = aten::type_as(%mask.13, %input.15) %565 : Tensor = aten::mul(%564, %input.15) %566 : float = aten::div(%1838, %p1m.12) %res.10 : Tensor = aten::mul(%565, %566) -> (%mask.13, %res.10) block1(): %mask.14 : Tensor = aten::empty_like(%input.15) %569 : Tensor = aten::bernoulli_(%mask.14, %p1m.12, %1837) %570 : Tensor = aten::mul(%mask.14, %input.15) %res.11 : Tensor = aten::div(%570, %p1m.12) -> (%mask.14, %res.11) %158 : Float(40!, 10!) = aten::t(%weight), scope: BERT/SublayerConnection/PositionwiseFeedForward/Linear[w_2] %output.6 : Float(1, 3, 10) = aten::matmul(%res.20, %158), scope: BERT/SublayerConnection/PositionwiseFeedForward/Linear[w_2] %440 : int[] = aten::size(%output.6) %443 : int[] = aten::size(%bias) %x.8 : Float(1, 3, 10) = aten::add(%output.6, %bias, %28) %mean : Float(1, 3, 1) = aten::mean(%x.8, %114, %44), scope: BERT/SublayerConnection/LayerNorm[norm] %self_size.3 : int[] = aten::size(%x.8) %std.3 : Float(1, 3, 1) = aten::std(%x.8, %114, %44, %44), scope: BERT/SublayerConnection/LayerNorm[norm] %307 : int[] = aten::size(%mean) %172 : Float(1, 3, 10) = aten::sub(%x.8, %mean, %28), scope: BERT/SublayerConnection/LayerNorm[norm] %173 : Float(1, 3, 10) = aten::mul(%19, %172), scope: BERT/SublayerConnection/LayerNorm[norm] %176 : Tensor = aten::add(%std.3, %126, %28) %177 : Float(1, 3, 10) = aten::div(%173, %176), scope: BERT/SublayerConnection/LayerNorm[norm] %268 : int[] = aten::size(%177) %271 : int[] = aten::size(%20) %input.16 : Float(1, 3, 10) = aten::add(%177, %20, %28), scope: BERT/SublayerConnection/LayerNorm[norm] %use_cuda.4 : bool = prim::is_cuda(%input.16) %mask.8 : Tensor, %res.6 : Float(1, 3, 10) = prim::If(%use_cuda.4) block0(): %238 : Tensor = aten::rand_like(%input.16) %mask.9 : Tensor = aten::lt(%238, %p1m.12) %240 : Tensor = aten::type_as(%mask.9, %input.16) %241 : Tensor = aten::mul(%240, %input.16) %242 : float = aten::div(%1838, %p1m.12) %res.7 : Tensor = aten::mul(%241, %242) -> (%mask.9, %res.7) block1(): %mask.10 : Tensor = aten::empty_like(%input.16) %245 : Tensor = aten::bernoulli_(%mask.10, %p1m.12, %1837) %246 : Tensor = aten::mul(%mask.10, %input.16) %res.8 : Tensor = aten::div(%246, %p1m.12) -> (%mask.10, %res.8) %228 : int[] = aten::size(%res.6) %input.17 : Float(1, 3, 10) = aten::add(%input.14, %res.6, %28), scope: BERT/SublayerConnection %use_cuda.2 : bool = prim::is_cuda(%input.17) %mask.4 : Tensor, %res.3 : Float(1, 3, 10) = prim::If(%use_cuda.2) block0(): %195 : Tensor = aten::rand_like(%input.17) %mask.5 : Tensor = aten::lt(%195, %p1m.12) %197 : Tensor = aten::type_as(%mask.5, %input.17) %198 : Tensor = aten::mul(%197, %input.17) %199 : float = aten::div(%1838, %p1m.12) %res.4 : Tensor = aten::mul(%198, %199) -> (%mask.5, %res.4) block1(): %mask.6 : Tensor = aten::empty_like(%input.17) %202 : Tensor = aten::bernoulli_(%mask.6, %p1m.12, %1837) %203 : Tensor = aten::mul(%mask.6, %input.17) %res.5 : Tensor = aten::div(%203, %p1m.12) -> (%mask.6, %res.5) return (%res.3, %weight_size_0.4, %1901, %weight_size_0.2, %1873, %1876, %input.9, %44, %1837, %1838, %use_cuda.12, %p1m.12, %mask.24, %res.18, %53, %1720, %1723, %self_size.21, %query.1, %65, %1578, %1581, %self_size.18, %77, %1436, %1439, %self_size.15, %value.1, %91, %94, %input.11, %use_cuda.10, %mask.20, %res.19, %input.12, %self_size.11, %109, %995, %998, %x.6, %114, %self_size.8, %std.2, %862, %123, %124, %127, %823, %826, %input.13, %use_cuda.8, %mask.16, %783, %input.14, %136, %663, %666, %x.7, %141, %628, %150, %153, %input.15, %use_cuda.6, %mask.12, %res.20, %158, %440, %443, %x.8, %self_size.3, %std.3, %307, %172, %173, %176, %268, %271, %input.16, %use_cuda.4, %mask.8, %228, %input.17, %use_cuda.2, %mask.4) =================== BACKPROP TORCH GRAPH =================== graph(%0 : Float(1, 3, 10), %1 : Float(1, 3, 10), %2 : Float(10!, 10!), %3 : Float(1!, 2!, 3!, 5), %4 : Float(10!, 10!), %5 : Float(10!, 10!), %6 : Float(1!, 2!, 3!, 5), %7 : Float(1!, 2, 5!, 3!), %8 : Tensor, %9 : Float(1, 2, 3, 3), %10 : Float(1, 3, 10), %11 : Float(10!, 10!), %12 : Float(1, 3, 10), %13 : Float(1, 3, 1), %14 : Float(1, 3, 10), %15 : Float(1, 3, 10), %16 : Tensor, %17 : Float(1, 3, 10), %18 : Float(1, 3, 10), %19 : Float(10!, 40!), %20 : Float(1, 3, 40), %21 : Tensor, %22 : Float(1, 3, 40), %23 : Tensor, %24 : Float(1, 3, 40), %25 : Float(40!, 10!), %26 : Float(1, 3, 10), %27 : Float(1, 3, 1), %28 : Float(1, 3, 10), %29 : Float(1, 3, 10), %30 : Tensor, %31 : Float(1, 3, 10), %32 : Float(1, 3, 10), %x.1 : Long(1, 3), %input.1 : Long(1, 3), %35 : Float(10), %36 : Float(10), %weight_size_0.3 : int, %38 : int[], %weight_size_0.1 : int, %40 : int[], %41 : int[], %input.2 : Float(1, 3, 10), %43 : bool, %44 : Generator?, %45 : float, %use_cuda.11 : bool, %p1m.11 : float, %mask.23 : Tensor, %res : Float(1, 3, 10), %50 : Float(10!, 10!), %51 : int[], %52 : int[], %self_size.20 : int[], %query : Float(1!, 2!, 3!, 5), %55 : Float(10!, 10!), %56 : int[], %57 : int[], %self_size.17 : int[], %59 : Float(10!, 10!), %60 : int[], %61 : int[], %self_size.14 : int[], %value : Float(1!, 2!, 3!, 5), %64 : Float(1!, 2, 5!, 3!), %65 : Tensor, %input.4 : Float(1, 2, 3, 3), %use_cuda.9 : bool, %mask.19 : Tensor, %res.15 : Float(1, 2, 3, 3), %input.5 : Float(1, 3, 10), %self_size.10 : int[], %72 : Float(10!, 10!), %73 : int[], %74 : int[], %x.3 : Float(1, 3, 10), %76 : int[], %self_size.7 : int[], %std.1 : Float(1, 3, 1), %79 : int[], %80 : Float(1, 3, 10), %81 : Float(1, 3, 10), %82 : Tensor, %83 : int[], %84 : int[], %input.6 : Float(1, 3, 10), %use_cuda.7 : bool, %mask.15 : Tensor, %88 : int[], %input.7 : Float(1, 3, 10), %90 : Float(10!, 40!), %91 : int[], %92 : int[], %x.4 : Float(1, 3, 40), %94 : Tensor, %95 : int[], %96 : Float(1, 3, 40), %97 : Tensor, %input.8 : Float(1, 3, 40), %use_cuda.5 : bool, %mask.11 : Tensor, %res.9 : Float(1, 3, 40), %102 : Float(40!, 10!), %103 : int[], %104 : int[], %x : Float(1, 3, 10), %self_size.2 : int[], %std : Float(1, 3, 1), %108 : int[], %109 : Float(1, 3, 10), %110 : Float(1, 3, 10), %111 : Tensor, %112 : int[], %113 : int[], %input.10 : Float(1, 3, 10), %use_cuda.3 : bool, %mask.7 : Tensor, %117 : int[], %input : Float(1, 3, 10), %use_cuda.1 : bool, %mask.3 : Tensor): %844 : None = prim::Constant() %472 : int? = prim::Constant() %471 : Device? = prim::Constant() %232 : float = prim::Constant[value=2]() %174 : float = prim::Constant[value=1]() %165 : float = prim::Constant[value=0.797885]() %163 : float = prim::Constant[value=0.044715]() %161 : float = prim::Constant[value=0]() %159 : int = prim::Constant[value=3](), scope: BERT/SublayerConnection/PositionwiseFeedForward/GELU[activation] %157 : float = prim::Constant[value=0.5]() %151 : bool = prim::Constant[value=1](), scope: BERT/SublayerConnection/LayerNorm[norm] %146 : float = prim::Constant[value=2.23607]() %145 : int = prim::Constant[value=-2](), scope: BERT/SublayerConnection/Attention %144 : int = prim::Constant[value=-1](), scope: BERT/SublayerConnection/Attention %136 : int = prim::Constant[value=2](), scope: BERT/SublayerConnection %134 : int = prim::Constant[value=1](), scope: BERT/BERTEmbedding[embedding] %130 : int = prim::Constant[value=0](), scope: BERT/BERTEmbedding[embedding]/TokenEmbedding[token] %128 : bool = prim::Constant[value=0](), scope: BERT/BERTEmbedding[embedding]/TokenEmbedding[token] %121 : int[] = aten::size(%input.7) %122 : int[] = aten::size(%111) %123 : int[] = aten::size(%110) %124 : int[] = aten::size(%x.4) %125 : int[] = aten::size(%res) %126 : int[] = aten::size(%82) %127 : int[] = aten::size(%81) %grad_input.4 : Tensor = prim::GradOf[name="aten::dropout"](%0) block0(): %grad_input.3 : Tensor = prim::If(%use_cuda.1) block0(): %p1r.1 : float = aten::div(%174, %p1m.11) %177 : Tensor = aten::type_as(%mask.3, %0) %178 : Tensor = aten::mul(%177, %p1r.1) %grad_input.5 : Tensor = aten::mul(%0, %178) -> (%grad_input.5) block1(): %180 : Tensor = aten::mul(%0, %mask.3) %grad_input.6 : Tensor = aten::div(%180, %p1m.11) -> (%grad_input.6) -> (%grad_input.3) %182 : Tensor = prim::AutogradAdd(%32, %grad_input.4) %183 : Tensor, %184 : Tensor = prim::GradOf[name="aten::add"](%182) block0(): %185 : Tensor = aten::_grad_sum_to_size(%182, %121) %186 : Tensor = aten::mul(%182, %134), scope: BERT/SublayerConnection %187 : Tensor = aten::_grad_sum_to_size(%186, %117), scope: BERT/SublayerConnection -> (%185, %187) %grad_input.8 : Tensor = prim::GradOf[name="aten::dropout"](%184) block0(): %grad_input.7 : Tensor = prim::If(%use_cuda.3) block0(): %p1r.2 : float = aten::div(%174, %p1m.11) %192 : Tensor = aten::type_as(%mask.7, %184) %193 : Tensor = aten::mul(%192, %p1r.2) %grad_input.9 : Tensor = aten::mul(%184, %193) -> (%grad_input.9) block1(): %195 : Tensor = aten::mul(%184, %mask.7) %grad_input.10 : Tensor = aten::div(%195, %p1m.11) -> (%grad_input.10) -> (%grad_input.7) %197 : Tensor = prim::AutogradAdd(%31, %grad_input.8) %198 : Tensor, %199 : Tensor = prim::GradOf[name="aten::add"](%197) block0(): %200 : Tensor = aten::_grad_sum_to_size(%197, %112) %201 : Tensor = aten::mul(%197, %134), scope: BERT/SublayerConnection/LayerNorm[norm] %202 : Tensor = aten::_grad_sum_to_size(%201, %113), scope: BERT/SublayerConnection/LayerNorm[norm] -> (%200, %202) %203 : Tensor, %204 : Tensor = prim::GradOf[name="aten::div"](%198) block0(): %205 : Tensor = aten::div(%198, %111) %206 : Tensor = aten::_grad_sum_to_size(%205, %123) %207 : Tensor = aten::mul(%111, %111) %208 : Tensor = aten::neg(%198) %209 : Tensor = aten::mul(%208, %110), scope: BERT/SublayerConnection/LayerNorm[norm] %210 : Tensor = aten::div(%209, %207), scope: BERT/SublayerConnection/LayerNorm[norm] %211 : Tensor = aten::_grad_sum_to_size(%210, %122), scope: BERT/SublayerConnection/LayerNorm[norm] -> (%206, %211) %212 : Tensor = prim::AutogradAdd(%30, %204) %213 : Tensor = prim::AutogradAdd(%29, %203) %214 : Tensor = prim::GradOf[name="aten::add"](%212) block0(): -> (%212) %215 : Tensor = prim::AutogradAdd(%27, %214) %grad_self.2 : Tensor, %grad_other.2 : Tensor = prim::GradOf[name="aten::mul"](%213) block0(): %218 : Tensor = aten::mul(%213, %109) %219 : int[] = aten::size(%36) %grad_self.1 : Tensor = aten::_grad_sum_to_size(%218, %219) %221 : Tensor = aten::mul(%213, %36) %222 : int[] = aten::size(%109) %grad_other.1 : Tensor = aten::_grad_sum_to_size(%221, %222) -> (%grad_self.1, %grad_other.1) %224 : Tensor = prim::AutogradAdd(%28, %grad_other.2) %225 : Tensor, %226 : Tensor = prim::GradOf[name="aten::sub"](%224) block0(): %227 : Tensor = aten::_grad_sum_to_size(%224, %self_size.2) %228 : Tensor = aten::neg(%224) %229 : Tensor = aten::mul(%228, %134), scope: BERT/SublayerConnection/LayerNorm[norm] %230 : Tensor = aten::_grad_sum_to_size(%229, %108), scope: BERT/SublayerConnection/LayerNorm[norm] -> (%227, %230) %grad_self.4 : Tensor = prim::GradOf[name="aten::std"](%215) block0(): %237 : Tensor = aten::mul(%std, %136) %238 : Tensor = aten::div(%215, %237) %239 : int = aten::dim(%x) %240 : bool = aten::eq(%239, %130) %grad_self.3 : Tensor = prim::If(%240) block0(): %i.4 : int = prim::If(%43) block0(): -> (%134) block1(): -> (%130) %243 : Tensor = aten::mean(%x) %244 : Tensor = aten::sub(%x, %243, %134) %245 : Tensor = aten::mul(%238, %244) %246 : Tensor = aten::mul(%245, %232) %247 : int = aten::numel(%x) %248 : int = aten::sub(%247, %i.4) %249 : Tensor = aten::div(%246, %248) -> (%249) block1(): %self_size.1 : int[] = aten::size(%x) %i.7 : int = prim::If(%43) block0(): -> (%134) block1(): -> (%130) %252 : bool = aten::__not__(%43) %253 : bool = prim::If(%252) block0(): %254 : int = aten::dim(%x) %255 : bool = aten::gt(%254, %134) -> (%255) block1(): -> (%128) %grad.3 : Tensor = prim::If(%253) block0(): %257 : int = aten::len(%self_size.1) %258 : bool[] = prim::ListConstruct(%128) %seen.1 : bool[] = aten::mul(%258, %257) %260 : int = aten::len(%76) = prim::Loop(%260, %151) block0(%i.8 : int): %262 : int = aten::select(%76, %i.8) %263 : bool[] = aten::_set_item(%seen.1, %262, %151) -> (%151) %t.1 : Tensor = prim::Loop(%257, %151, %238) block0(%d.2 : int, %266 : Tensor): %267 : bool = aten::select(%seen.1, %d.2) %t.4 : Tensor = prim::If(%267) block0(): %t.5 : Tensor = aten::unsqueeze(%266, %d.2) -> (%t.5) block1(): -> (%266) -> (%151, %t.4) -> (%t.1) block1(): -> (%238) %270 : Tensor = aten::mean(%x, %76, %151) %271 : Tensor = aten::sub(%x, %270, %134) %272 : Tensor = aten::mul(%grad.3, %271) %273 : Tensor = aten::mul(%272, %232) %274 : int = aten::len(%self_size.1) %275 : bool = aten::eq(%274, %130) %276 : int = prim::If(%275) block0(): -> (%134) block1(): %277 : int = aten::len(%76) %size.2 : int = prim::Loop(%277, %151, %134) block0(%i.5 : int, %280 : int): %d.3 : int = aten::select(%76, %i.5) %282 : int = aten::select(%self_size.1, %d.3) %size.3 : int = aten::mul(%280, %282) -> (%151, %size.3) -> (%size.2) %284 : int = aten::sub(%276, %i.7) %285 : Tensor = aten::div(%273, %284) -> (%285) -> (%grad_self.3) %286 : Tensor = prim::AutogradAdd(%225, %grad_self.4) %grad_self.6 : Tensor = prim::GradOf[name="aten::mean"](%226) block0(): %292 : bool = aten::__not__(%151) %293 : bool = prim::If(%292) block0(): %294 : int = aten::len(%self_size.2) %295 : bool = aten::gt(%294, %130) -> (%295) block1(): -> (%128) %296 : Tensor = prim::If(%293) block0(): %297 : int = aten::len(%76) %298 : bool = aten::eq(%297, %134) %299 : Tensor = prim::If(%298) block0(): %300 : int = aten::select(%76, %130) %301 : Tensor = aten::unsqueeze(%226, %300) %302 : Tensor = aten::expand(%301, %self_size.2, %128) -> (%302) block1(): %303 : int = aten::len(%self_size.2) %304 : bool[] = prim::ListConstruct(%128) %seen.2 : bool[] = aten::mul(%304, %303) %306 : int = aten::len(%76) = prim::Loop(%306, %151) block0(%i.6 : int): %308 : int = aten::select(%76, %i.6) %309 : bool[] = aten::_set_item(%seen.2, %308, %151) -> (%151) %t.6 : Tensor = prim::Loop(%303, %151, %226) block0(%d.4 : int, %312 : Tensor): %313 : bool = aten::select(%seen.2, %d.4) %t.7 : Tensor = prim::If(%313) block0(): %t.8 : Tensor = aten::unsqueeze(%312, %d.4) -> (%t.8) block1(): -> (%312) -> (%151, %t.7) %316 : Tensor = aten::expand(%t.6, %self_size.2, %128) -> (%316) -> (%299) block1(): %317 : Tensor = aten::expand(%226, %self_size.2, %128) -> (%317) %318 : int = aten::len(%self_size.2) %319 : bool = aten::eq(%318, %130) %320 : int = prim::If(%319) block0(): -> (%134) block1(): %321 : int = aten::len(%76) %size.4 : int = prim::Loop(%321, %151, %134) block0(%i.9 : int, %324 : int): %d.5 : int = aten::select(%76, %i.9) %326 : int = aten::select(%self_size.2, %d.5) %size.5 : int = aten::mul(%324, %326) -> (%151, %size.5) -> (%size.4) %grad_self.5 : Tensor = aten::div(%296, %320) -> (%grad_self.5) %329 : Tensor = prim::AutogradAdd(%286, %grad_self.6) %330 : Tensor = prim::AutogradAdd(%26, %329) %331 : Tensor, %332 : Tensor = prim::GradOf[name="aten::add"](%330) block0(): %333 : Tensor = aten::_grad_sum_to_size(%330, %103) %334 : Tensor = aten::mul(%330, %134), scope: BERT/SublayerConnection/PositionwiseFeedForward/Linear[w_2] %335 : Tensor = aten::_grad_sum_to_size(%334, %104), scope: BERT/SublayerConnection/PositionwiseFeedForward/Linear[w_2] -> (%333, %335) %grad_self.8 : Tensor, %grad_other.4 : Tensor = prim::GradOf[name="aten::matmul"](%331) block0(): %self_size.4 : int[] = aten::size(%res.9) %other_size.1 : int[] = aten::size(%102) %dim.4 : int = aten::dim(%102) %347 : bool = aten::eq(%dim.4, %134) %out.26 : Tensor = prim::If(%347) block0(): -> (%102) block1(): %349 : bool = aten::eq(%dim.4, %136) %out.27 : Tensor = prim::If(%349) block0(): %out.28 : Tensor = aten::t(%102) -> (%out.28) block1(): %dims.2 : int[] = prim::rangelist(%dim.4) %353 : int = aten::sub(%dim.4, %136) %354 : int[] = aten::_set_item(%dims.2, %144, %353) %355 : int = aten::sub(%dim.4, %134) %356 : int[] = aten::_set_item(%dims.2, %145, %355) %out.29 : Tensor = aten::permute(%102, %dims.2) -> (%out.29) -> (%out.27) %dim1.2 : int = aten::dim(%331) %dim2.2 : int = aten::dim(%out.26) %dim_out.2 : int = aten::len(%self_size.4) %361 : bool = aten::eq(%dim1.2, %130) %362 : bool = prim::If(%361) block0(): -> (%151) block1(): %363 : bool = aten::eq(%dim2.2, %130) -> (%363) %out.30 : Tensor = prim::If(%362) block0(): %out.31 : Tensor = aten::mul(%331, %out.26) -> (%out.31) block1(): %366 : int = aten::add(%dim1.2, %dim2.2) %367 : bool = aten::eq(%366, %dim_out.2) %out.32 : Tensor = prim::If(%367) block0(): %369 : bool = aten::eq(%dim2.2, %134) %target_dim2.2 : int = prim::If(%369) block0(): -> (%130) block1(): -> (%145) %371 : Tensor = aten::unsqueeze(%331, %dim1.2) %372 : Tensor = aten::unsqueeze(%out.26, %target_dim2.2) %out.33 : Tensor = aten::matmul(%371, %372) -> (%out.33) block1(): %374 : int = aten::sub(%dim1.2, %dim2.2) %375 : bool = aten::eq(%dim_out.2, %374) %out.34 : Tensor = prim::If(%375) block0(): %377 : Tensor = aten::unsqueeze(%out.26, %dim2.2) %378 : Tensor = aten::matmul(%331, %377) %out.35 : Tensor = aten::squeeze(%378, %144) -> (%out.35) block1(): %380 : int = aten::sub(%dim2.2, %dim1.2) %381 : bool = aten::eq(%dim_out.2, %380) %out.36 : Tensor = prim::If(%381) block0(): %383 : Tensor = aten::unsqueeze(%331, %145) %384 : Tensor = aten::matmul(%383, %out.26) %out.37 : Tensor = aten::squeeze(%384, %145) -> (%out.37) block1(): %out.38 : Tensor = aten::matmul(%331, %out.26) -> (%out.38) -> (%out.36) -> (%out.34) -> (%out.32) %grad_self.7 : Tensor = aten::_grad_sum_to_size(%out.30, %self_size.4) %dim.5 : int = aten::dim(%res.9) %389 : bool = aten::eq(%dim.5, %134) %out.39 : Tensor = prim::If(%389) block0(): -> (%res.9) block1(): %391 : bool = aten::eq(%dim.5, %136) %out.40 : Tensor = prim::If(%391) block0(): %out.41 : Tensor = aten::t(%res.9) -> (%out.41) block1(): %dims.3 : int[] = prim::rangelist(%dim.5) %395 : int = aten::sub(%dim.5, %136) %396 : int[] = aten::_set_item(%dims.3, %144, %395) %397 : int = aten::sub(%dim.5, %134) %398 : int[] = aten::_set_item(%dims.3, %145, %397) %out.42 : Tensor = aten::permute(%res.9, %dims.3) -> (%out.42) -> (%out.40) %dim1.3 : int = aten::dim(%out.39) %dim2.3 : int = aten::dim(%331) %dim_out.3 : int = aten::len(%other_size.1) %403 : bool = aten::eq(%dim1.3, %130) %404 : bool = prim::If(%403) block0(): -> (%151) block1(): %405 : bool = aten::eq(%dim2.3, %130) -> (%405) %out.43 : Tensor = prim::If(%404) block0(): %out.44 : Tensor = aten::mul(%out.39, %331) -> (%out.44) block1(): %408 : int = aten::add(%dim1.3, %dim2.3) %409 : bool = aten::eq(%408, %dim_out.3) %out.45 : Tensor = prim::If(%409) block0(): %411 : bool = aten::eq(%dim2.3, %134) %target_dim2.3 : int = prim::If(%411) block0(): -> (%130) block1(): -> (%145) %413 : Tensor = aten::unsqueeze(%out.39, %dim1.3) %414 : Tensor = aten::unsqueeze(%331, %target_dim2.3) %out.46 : Tensor = aten::matmul(%413, %414) -> (%out.46) block1(): %416 : int = aten::sub(%dim1.3, %dim2.3) %417 : bool = aten::eq(%dim_out.3, %416) %out.47 : Tensor = prim::If(%417) block0(): %419 : Tensor = aten::unsqueeze(%331, %dim2.3) %420 : Tensor = aten::matmul(%out.39, %419) %out.48 : Tensor = aten::squeeze(%420, %144) -> (%out.48) block1(): %422 : int = aten::sub(%dim2.3, %dim1.3) %423 : bool = aten::eq(%dim_out.3, %422) %out.49 : Tensor = prim::If(%423) block0(): %425 : Tensor = aten::unsqueeze(%out.39, %145) %426 : Tensor = aten::matmul(%425, %331) %out.50 : Tensor = aten::squeeze(%426, %145) -> (%out.50) block1(): %out.51 : Tensor = aten::matmul(%out.39, %331) -> (%out.51) -> (%out.49) -> (%out.47) -> (%out.45) %grad_other.3 : Tensor = aten::_grad_sum_to_size(%out.43, %other_size.1) -> (%grad_self.7, %grad_other.3) %430 : Tensor = prim::AutogradAdd(%25, %grad_other.4) %grad_self.10 : Tensor = prim::GradOf[name="aten::t"](%430) block0(): %grad_self.9 : Tensor = aten::t(%430) -> (%grad_self.9) %grad_input.12 : Tensor = prim::GradOf[name="aten::dropout"](%grad_self.8) block0(): %grad_input.11 : Tensor = prim::If(%use_cuda.5) block0(): %p1r.3 : float = aten::div(%174, %p1m.11) %437 : Tensor = aten::type_as(%mask.11, %grad_self.8) %438 : Tensor = aten::mul(%437, %p1r.3) %grad_input.13 : Tensor = aten::mul(%grad_self.8, %438) -> (%grad_input.13) block1(): %440 : Tensor = aten::mul(%grad_self.8, %mask.11) %grad_input.14 : Tensor = aten::div(%440, %p1m.11) -> (%grad_input.14) -> (%grad_input.11) %442 : Tensor = prim::AutogradAdd(%24, %grad_input.12) %grad_self.12 : Tensor, %grad_other.6 : Tensor = prim::GradOf[name="aten::mul"](%442) block0(): %445 : Tensor = aten::mul(%442, %97) %446 : int[] = aten::size(%94) %grad_self.11 : Tensor = aten::_grad_sum_to_size(%445, %446) %448 : Tensor = aten::mul(%442, %94) %449 : int[] = aten::size(%97) %grad_other.5 : Tensor = aten::_grad_sum_to_size(%448, %449) -> (%grad_self.11, %grad_other.5) %451 : Tensor = prim::AutogradAdd(%23, %grad_other.6) %452 : Tensor = prim::AutogradAdd(%21, %grad_self.12) %grad_other.7 : Tensor = prim::GradOf[name="aten::add"](%451) block0(): -> (%451) %454 : Tensor = prim::AutogradAdd(%22, %grad_other.7) %455 : Tensor = prim::GradOf[name="aten::tanh"](%454) block0(): %457 : Tensor = aten::mul(%96, %96) %458 : Tensor = aten::neg(%457) %459 : Tensor = aten::add(%458, %134, %134) %460 : Tensor = aten::mul(%454, %459) -> (%460) %461 : Tensor = prim::GradOf[name="aten::mul"](%455) block0(): %462 : Tensor = aten::mul(%455, %165) -> (%462) %463 : Tensor, %464 : Tensor = prim::GradOf[name="aten::add"](%461) block0(): %465 : Tensor = aten::_grad_sum_to_size(%461, %124) %466 : Tensor = aten::mul(%461, %134), scope: BERT/SublayerConnection/PositionwiseFeedForward/GELU[activation] %467 : Tensor = aten::_grad_sum_to_size(%466, %95), scope: BERT/SublayerConnection/PositionwiseFeedForward/GELU[activation] -> (%465, %467) %468 : Tensor = prim::GradOf[name="aten::mul"](%464) block0(): %469 : Tensor = aten::mul(%464, %163) -> (%469) %grad_self.14 : Tensor = prim::GradOf[name="aten::pow"](%468) block0(): %473 : bool = aten::eq(%159, %161) %474 : Tensor = aten::tensor(%473, %472, %471) %475 : Tensor = aten::zeros_like(%x.4) %476 : Tensor = aten::mul(%468, %159) %477 : float = aten::sub(%159, %134) %478 : Tensor = aten::pow(%x.4, %477) %479 : Tensor = aten::mul(%476, %478) %grad_self.13 : Tensor = aten::where(%474, %475, %479) -> (%grad_self.13) %481 : Tensor = prim::AutogradAdd(%463, %grad_self.14) %482 : Tensor = prim::GradOf[name="aten::mul"](%452) block0(): %483 : Tensor = aten::mul(%452, %157) -> (%483) %484 : Tensor = prim::AutogradAdd(%481, %482) %485 : Tensor = prim::AutogradAdd(%20, %484) %486 : Tensor, %487 : Tensor = prim::GradOf[name="aten::add"](%485) block0(): %488 : Tensor = aten::_grad_sum_to_size(%485, %91) %489 : Tensor = aten::mul(%485, %134), scope: BERT/SublayerConnection/PositionwiseFeedForward/Linear[w_1] %490 : Tensor = aten::_grad_sum_to_size(%489, %92), scope: BERT/SublayerConnection/PositionwiseFeedForward/Linear[w_1] -> (%488, %490) %grad_self.16 : Tensor, %grad_other.9 : Tensor = prim::GradOf[name="aten::matmul"](%486) block0(): %self_size.5 : int[] = aten::size(%input.7) %other_size.2 : int[] = aten::size(%90) %dim.8 : int = aten::dim(%90) %502 : bool = aten::eq(%dim.8, %134) %out.52 : Tensor = prim::If(%502) block0(): -> (%90) block1(): %504 : bool = aten::eq(%dim.8, %136) %out.53 : Tensor = prim::If(%504) block0(): %out.54 : Tensor = aten::t(%90) -> (%out.54) block1(): %dims.4 : int[] = prim::rangelist(%dim.8) %508 : int = aten::sub(%dim.8, %136) %509 : int[] = aten::_set_item(%dims.4, %144, %508) %510 : int = aten::sub(%dim.8, %134) %511 : int[] = aten::_set_item(%dims.4, %145, %510) %out.55 : Tensor = aten::permute(%90, %dims.4) -> (%out.55) -> (%out.53) %dim1.4 : int = aten::dim(%486) %dim2.4 : int = aten::dim(%out.52) %dim_out.4 : int = aten::len(%self_size.5) %516 : bool = aten::eq(%dim1.4, %130) %517 : bool = prim::If(%516) block0(): -> (%151) block1(): %518 : bool = aten::eq(%dim2.4, %130) -> (%518) %out.56 : Tensor = prim::If(%517) block0(): %out.57 : Tensor = aten::mul(%486, %out.52) -> (%out.57) block1(): %521 : int = aten::add(%dim1.4, %dim2.4) %522 : bool = aten::eq(%521, %dim_out.4) %out.58 : Tensor = prim::If(%522) block0(): %524 : bool = aten::eq(%dim2.4, %134) %target_dim2.4 : int = prim::If(%524) block0(): -> (%130) block1(): -> (%145) %526 : Tensor = aten::unsqueeze(%486, %dim1.4) %527 : Tensor = aten::unsqueeze(%out.52, %target_dim2.4) %out.59 : Tensor = aten::matmul(%526, %527) -> (%out.59) block1(): %529 : int = aten::sub(%dim1.4, %dim2.4) %530 : bool = aten::eq(%dim_out.4, %529) %out.60 : Tensor = prim::If(%530) block0(): %532 : Tensor = aten::unsqueeze(%out.52, %dim2.4) %533 : Tensor = aten::matmul(%486, %532) %out.61 : Tensor = aten::squeeze(%533, %144) -> (%out.61) block1(): %535 : int = aten::sub(%dim2.4, %dim1.4) %536 : bool = aten::eq(%dim_out.4, %535) %out.62 : Tensor = prim::If(%536) block0(): %538 : Tensor = aten::unsqueeze(%486, %145) %539 : Tensor = aten::matmul(%538, %out.52) %out.63 : Tensor = aten::squeeze(%539, %145) -> (%out.63) block1(): %out.64 : Tensor = aten::matmul(%486, %out.52) -> (%out.64) -> (%out.62) -> (%out.60) -> (%out.58) %grad_self.15 : Tensor = aten::_grad_sum_to_size(%out.56, %self_size.5) %dim.6 : int = aten::dim(%input.7) %544 : bool = aten::eq(%dim.6, %134) %out.65 : Tensor = prim::If(%544) block0(): -> (%input.7) block1(): %546 : bool = aten::eq(%dim.6, %136) %out.66 : Tensor = prim::If(%546) block0(): %out.67 : Tensor = aten::t(%input.7) -> (%out.67) block1(): %dims.5 : int[] = prim::rangelist(%dim.6) %550 : int = aten::sub(%dim.6, %136) %551 : int[] = aten::_set_item(%dims.5, %144, %550) %552 : int = aten::sub(%dim.6, %134) %553 : int[] = aten::_set_item(%dims.5, %145, %552) %out.68 : Tensor = aten::permute(%input.7, %dims.5) -> (%out.68) -> (%out.66) %dim1.5 : int = aten::dim(%out.65) %dim2.5 : int = aten::dim(%486) %dim_out.5 : int = aten::len(%other_size.2) %558 : bool = aten::eq(%dim1.5, %130) %559 : bool = prim::If(%558) block0(): -> (%151) block1(): %560 : bool = aten::eq(%dim2.5, %130) -> (%560) %out.69 : Tensor = prim::If(%559) block0(): %out.70 : Tensor = aten::mul(%out.65, %486) -> (%out.70) block1(): %563 : int = aten::add(%dim1.5, %dim2.5) %564 : bool = aten::eq(%563, %dim_out.5) %out.71 : Tensor = prim::If(%564) block0(): %566 : bool = aten::eq(%dim2.5, %134) %target_dim2.5 : int = prim::If(%566) block0(): -> (%130) block1(): -> (%145) %568 : Tensor = aten::unsqueeze(%out.65, %dim1.5) %569 : Tensor = aten::unsqueeze(%486, %target_dim2.5) %out.72 : Tensor = aten::matmul(%568, %569) -> (%out.72) block1(): %571 : int = aten::sub(%dim1.5, %dim2.5) %572 : bool = aten::eq(%dim_out.5, %571) %out.73 : Tensor = prim::If(%572) block0(): %574 : Tensor = aten::unsqueeze(%486, %dim2.5) %575 : Tensor = aten::matmul(%out.65, %574) %out.74 : Tensor = aten::squeeze(%575, %144) -> (%out.74) block1(): %577 : int = aten::sub(%dim2.5, %dim1.5) %578 : bool = aten::eq(%dim_out.5, %577) %out.75 : Tensor = prim::If(%578) block0(): %580 : Tensor = aten::unsqueeze(%out.65, %145) %581 : Tensor = aten::matmul(%580, %486) %out.76 : Tensor = aten::squeeze(%581, %145) -> (%out.76) block1(): %out.77 : Tensor = aten::matmul(%out.65, %486) -> (%out.77) -> (%out.75) -> (%out.73) -> (%out.71) %grad_other.8 : Tensor = aten::_grad_sum_to_size(%out.69, %other_size.2) -> (%grad_self.15, %grad_other.8) %585 : Tensor = prim::AutogradAdd(%19, %grad_other.9) %586 : Tensor = prim::AutogradAdd(%183, %grad_self.16) %587 : Tensor = prim::AutogradAdd(%18, %586) %grad_self.18 : Tensor = prim::GradOf[name="aten::t"](%585) block0(): %grad_self.17 : Tensor = aten::t(%585) -> (%grad_self.17) %590 : Tensor, %591 : Tensor = prim::GradOf[name="aten::add"](%587) block0(): %592 : Tensor = aten::_grad_sum_to_size(%587, %125) %593 : Tensor = aten::mul(%587, %134), scope: BERT/SublayerConnection %594 : Tensor = aten::_grad_sum_to_size(%593, %88), scope: BERT/SublayerConnection -> (%592, %594) %grad_input.16 : Tensor = prim::GradOf[name="aten::dropout"](%591) block0(): %grad_input.15 : Tensor = prim::If(%use_cuda.7) block0(): %p1r.4 : float = aten::div(%174, %p1m.11) %599 : Tensor = aten::type_as(%mask.15, %591) %600 : Tensor = aten::mul(%599, %p1r.4) %grad_input.17 : Tensor = aten::mul(%591, %600) -> (%grad_input.17) block1(): %602 : Tensor = aten::mul(%591, %mask.15) %grad_input.18 : Tensor = aten::div(%602, %p1m.11) -> (%grad_input.18) -> (%grad_input.15) %604 : Tensor = prim::AutogradAdd(%17, %grad_input.16) %605 : Tensor, %606 : Tensor = prim::GradOf[name="aten::add"](%604) block0(): %607 : Tensor = aten::_grad_sum_to_size(%604, %83) %608 : Tensor = aten::mul(%604, %134), scope: BERT/SublayerConnection/LayerNorm[norm] %609 : Tensor = aten::_grad_sum_to_size(%608, %84), scope: BERT/SublayerConnection/LayerNorm[norm] -> (%607, %609) %610 : Tensor, %611 : Tensor = prim::GradOf[name="aten::div"](%605) block0(): %612 : Tensor = aten::div(%605, %82) %613 : Tensor = aten::_grad_sum_to_size(%612, %127) %614 : Tensor = aten::mul(%82, %82) %615 : Tensor = aten::neg(%605) %616 : Tensor = aten::mul(%615, %81), scope: BERT/SublayerConnection/LayerNorm[norm] %617 : Tensor = aten::div(%616, %614), scope: BERT/SublayerConnection/LayerNorm[norm] %618 : Tensor = aten::_grad_sum_to_size(%617, %126), scope: BERT/SublayerConnection/LayerNorm[norm] -> (%613, %618) %619 : Tensor = prim::AutogradAdd(%16, %611) %620 : Tensor = prim::AutogradAdd(%15, %610) %621 : Tensor = prim::GradOf[name="aten::add"](%619) block0(): -> (%619) %622 : Tensor = prim::AutogradAdd(%13, %621) %grad_self.20 : Tensor, %grad_other.11 : Tensor = prim::GradOf[name="aten::mul"](%620) block0(): %625 : Tensor = aten::mul(%620, %80) %626 : int[] = aten::size(%35) %grad_self.19 : Tensor = aten::_grad_sum_to_size(%625, %626) %628 : Tensor = aten::mul(%620, %35) %629 : int[] = aten::size(%80) %grad_other.10 : Tensor = aten::_grad_sum_to_size(%628, %629) -> (%grad_self.19, %grad_other.10) %631 : Tensor = prim::AutogradAdd(%14, %grad_other.11) %632 : Tensor, %633 : Tensor = prim::GradOf[name="aten::sub"](%631) block0(): %634 : Tensor = aten::_grad_sum_to_size(%631, %self_size.7) %635 : Tensor = aten::neg(%631) %636 : Tensor = aten::mul(%635, %134), scope: BERT/SublayerConnection/LayerNorm[norm] %637 : Tensor = aten::_grad_sum_to_size(%636, %79), scope: BERT/SublayerConnection/LayerNorm[norm] -> (%634, %637) %grad_self.22 : Tensor = prim::GradOf[name="aten::std"](%622) block0(): %644 : Tensor = aten::mul(%std.1, %136) %645 : Tensor = aten::div(%622, %644) %646 : int = aten::dim(%x.3) %647 : bool = aten::eq(%646, %130) %grad_self.21 : Tensor = prim::If(%647) block0(): %i.10 : int = prim::If(%43) block0(): -> (%134) block1(): -> (%130) %650 : Tensor = aten::mean(%x.3) %651 : Tensor = aten::sub(%x.3, %650, %134) %652 : Tensor = aten::mul(%645, %651) %653 : Tensor = aten::mul(%652, %232) %654 : int = aten::numel(%x.3) %655 : int = aten::sub(%654, %i.10) %656 : Tensor = aten::div(%653, %655) -> (%656) block1(): %self_size.6 : int[] = aten::size(%x.3) %i.2 : int = prim::If(%43) block0(): -> (%134) block1(): -> (%130) %659 : bool = aten::__not__(%43) %660 : bool = prim::If(%659) block0(): %661 : int = aten::dim(%x.3) %662 : bool = aten::gt(%661, %134) -> (%662) block1(): -> (%128) %grad.2 : Tensor = prim::If(%660) block0(): %664 : int = aten::len(%self_size.6) %665 : bool[] = prim::ListConstruct(%128) %seen.3 : bool[] = aten::mul(%665, %664) %667 : int = aten::len(%76) = prim::Loop(%667, %151) block0(%i.3 : int): %669 : int = aten::select(%76, %i.3) %670 : bool[] = aten::_set_item(%seen.3, %669, %151) -> (%151) %t.9 : Tensor = prim::Loop(%664, %151, %645) block0(%d.6 : int, %673 : Tensor): %674 : bool = aten::select(%seen.3, %d.6) %t.10 : Tensor = prim::If(%674) block0(): %t.11 : Tensor = aten::unsqueeze(%673, %d.6) -> (%t.11) block1(): -> (%673) -> (%151, %t.10) -> (%t.9) block1(): -> (%645) %677 : Tensor = aten::mean(%x.3, %76, %151) %678 : Tensor = aten::sub(%x.3, %677, %134) %679 : Tensor = aten::mul(%grad.2, %678) %680 : Tensor = aten::mul(%679, %232) %681 : int = aten::len(%self_size.6) %682 : bool = aten::eq(%681, %130) %683 : int = prim::If(%682) block0(): -> (%134) block1(): %684 : int = aten::len(%76) %size.6 : int = prim::Loop(%684, %151, %134) block0(%i.11 : int, %687 : int): %d.7 : int = aten::select(%76, %i.11) %689 : int = aten::select(%self_size.6, %d.7) %size.7 : int = aten::mul(%687, %689) -> (%151, %size.7) -> (%size.6) %691 : int = aten::sub(%683, %i.2) %692 : Tensor = aten::div(%680, %691) -> (%692) -> (%grad_self.21) %693 : Tensor = prim::AutogradAdd(%632, %grad_self.22) %grad_self.24 : Tensor = prim::GradOf[name="aten::mean"](%633) block0(): %699 : bool = aten::__not__(%151) %700 : bool = prim::If(%699) block0(): %701 : int = aten::len(%self_size.7) %702 : bool = aten::gt(%701, %130) -> (%702) block1(): -> (%128) %703 : Tensor = prim::If(%700) block0(): %704 : int = aten::len(%76) %705 : bool = aten::eq(%704, %134) %706 : Tensor = prim::If(%705) block0(): %707 : int = aten::select(%76, %130) %708 : Tensor = aten::unsqueeze(%633, %707) %709 : Tensor = aten::expand(%708, %self_size.7, %128) -> (%709) block1(): %710 : int = aten::len(%self_size.7) %711 : bool[] = prim::ListConstruct(%128) %seen : bool[] = aten::mul(%711, %710) %713 : int = aten::len(%76) = prim::Loop(%713, %151) block0(%i.1 : int): %715 : int = aten::select(%76, %i.1) %716 : bool[] = aten::_set_item(%seen, %715, %151) -> (%151) %t : Tensor = prim::Loop(%710, %151, %633) block0(%d.1 : int, %719 : Tensor): %720 : bool = aten::select(%seen, %d.1) %t.3 : Tensor = prim::If(%720) block0(): %t.2 : Tensor = aten::unsqueeze(%719, %d.1) -> (%t.2) block1(): -> (%719) -> (%151, %t.3) %723 : Tensor = aten::expand(%t, %self_size.7, %128) -> (%723) -> (%706) block1(): %724 : Tensor = aten::expand(%633, %self_size.7, %128) -> (%724) %725 : int = aten::len(%self_size.7) %726 : bool = aten::eq(%725, %130) %727 : int = prim::If(%726) block0(): -> (%134) block1(): %728 : int = aten::len(%76) %size : int = prim::Loop(%728, %151, %134) block0(%i : int, %731 : int): %d : int = aten::select(%76, %i) %733 : int = aten::select(%self_size.7, %d) %size.1 : int = aten::mul(%731, %733) -> (%151, %size.1) -> (%size) %grad_self.23 : Tensor = aten::div(%703, %727) -> (%grad_self.23) %736 : Tensor = prim::AutogradAdd(%693, %grad_self.24) %737 : Tensor = prim::AutogradAdd(%12, %736) %738 : Tensor, %739 : Tensor = prim::GradOf[name="aten::add"](%737) block0(): %740 : Tensor = aten::_grad_sum_to_size(%737, %73) %741 : Tensor = aten::mul(%737, %134), scope: BERT/SublayerConnection/Linear %742 : Tensor = aten::_grad_sum_to_size(%741, %74), scope: BERT/SublayerConnection/Linear -> (%740, %742) %grad_self.26 : Tensor, %grad_other.13 : Tensor = prim::GradOf[name="aten::matmul"](%738) block0(): %self_size.9 : int[] = aten::size(%input.5) %other_size.3 : int[] = aten::size(%72) %dim.10 : int = aten::dim(%72) %754 : bool = aten::eq(%dim.10, %134) %out.78 : Tensor = prim::If(%754) block0(): -> (%72) block1(): %756 : bool = aten::eq(%dim.10, %136) %out.79 : Tensor = prim::If(%756) block0(): %out.80 : Tensor = aten::t(%72) -> (%out.80) block1(): %dims.6 : int[] = prim::rangelist(%dim.10) %760 : int = aten::sub(%dim.10, %136) %761 : int[] = aten::_set_item(%dims.6, %144, %760) %762 : int = aten::sub(%dim.10, %134) %763 : int[] = aten::_set_item(%dims.6, %145, %762) %out.81 : Tensor = aten::permute(%72, %dims.6) -> (%out.81) -> (%out.79) %dim1.7 : int = aten::dim(%738) %dim2.6 : int = aten::dim(%out.78) %dim_out.6 : int = aten::len(%self_size.9) %768 : bool = aten::eq(%dim1.7, %130) %769 : bool = prim::If(%768) block0(): -> (%151) block1(): %770 : bool = aten::eq(%dim2.6, %130) -> (%770) %out.82 : Tensor = prim::If(%769) block0(): %out.83 : Tensor = aten::mul(%738, %out.78) -> (%out.83) block1(): %773 : int = aten::add(%dim1.7, %dim2.6) %774 : bool = aten::eq(%773, %dim_out.6) %out.84 : Tensor = prim::If(%774) block0(): %776 : bool = aten::eq(%dim2.6, %134) %target_dim2.6 : int = prim::If(%776) block0(): -> (%130) block1(): -> (%145) %778 : Tensor = aten::unsqueeze(%738, %dim1.7) %779 : Tensor = aten::unsqueeze(%out.78, %target_dim2.6) %out.85 : Tensor = aten::matmul(%778, %779) -> (%out.85) block1(): %781 : int = aten::sub(%dim1.7, %dim2.6) %782 : bool = aten::eq(%dim_out.6, %781) %out.86 : Tensor = prim::If(%782) block0(): %784 : Tensor = aten::unsqueeze(%out.78, %dim2.6) %785 : Tensor = aten::matmul(%738, %784) %out.87 : Tensor = aten::squeeze(%785, %144) -> (%out.87) block1(): %787 : int = aten::sub(%dim2.6, %dim1.7) %788 : bool = aten::eq(%dim_out.6, %787) %out.88 : Tensor = prim::If(%788) block0(): %790 : Tensor = aten::unsqueeze(%738, %145) %791 : Tensor = aten::matmul(%790, %out.78) %out.89 : Tensor = aten::squeeze(%791, %145) -> (%out.89) block1(): %out.90 : Tensor = aten::matmul(%738, %out.78) -> (%out.90) -> (%out.88) -> (%out.86) -> (%out.84) %grad_self.25 : Tensor = aten::_grad_sum_to_size(%out.82, %self_size.9) %dim.11 : int = aten::dim(%input.5) %796 : bool = aten::eq(%dim.11, %134) %out.91 : Tensor = prim::If(%796) block0(): -> (%input.5) block1(): %798 : bool = aten::eq(%dim.11, %136) %out.92 : Tensor = prim::If(%798) block0(): %out.93 : Tensor = aten::t(%input.5) -> (%out.93) block1(): %dims.7 : int[] = prim::rangelist(%dim.11) %802 : int = aten::sub(%dim.11, %136) %803 : int[] = aten::_set_item(%dims.7, %144, %802) %804 : int = aten::sub(%dim.11, %134) %805 : int[] = aten::_set_item(%dims.7, %145, %804) %out.94 : Tensor = aten::permute(%input.5, %dims.7) -> (%out.94) -> (%out.92) %dim1.6 : int = aten::dim(%out.91) %dim2.7 : int = aten::dim(%738) %dim_out.7 : int = aten::len(%other_size.3) %810 : bool = aten::eq(%dim1.6, %130) %811 : bool = prim::If(%810) block0(): -> (%151) block1(): %812 : bool = aten::eq(%dim2.7, %130) -> (%812) %out.95 : Tensor = prim::If(%811) block0(): %out.96 : Tensor = aten::mul(%out.91, %738) -> (%out.96) block1(): %815 : int = aten::add(%dim1.6, %dim2.7) %816 : bool = aten::eq(%815, %dim_out.7) %out.97 : Tensor = prim::If(%816) block0(): %818 : bool = aten::eq(%dim2.7, %134) %target_dim2.7 : int = prim::If(%818) block0(): -> (%130) block1(): -> (%145) %820 : Tensor = aten::unsqueeze(%out.91, %dim1.6) %821 : Tensor = aten::unsqueeze(%738, %target_dim2.7) %out.98 : Tensor = aten::matmul(%820, %821) -> (%out.98) block1(): %823 : int = aten::sub(%dim1.6, %dim2.7) %824 : bool = aten::eq(%dim_out.7, %823) %out.99 : Tensor = prim::If(%824) block0(): %826 : Tensor = aten::unsqueeze(%738, %dim2.7) %827 : Tensor = aten::matmul(%out.91, %826) %out.100 : Tensor = aten::squeeze(%827, %144) -> (%out.100) block1(): %829 : int = aten::sub(%dim2.7, %dim1.6) %830 : bool = aten::eq(%dim_out.7, %829) %out.101 : Tensor = prim::If(%830) block0(): %832 : Tensor = aten::unsqueeze(%out.91, %145) %833 : Tensor = aten::matmul(%832, %738) %out.102 : Tensor = aten::squeeze(%833, %145) -> (%out.102) block1(): %out.103 : Tensor = aten::matmul(%out.91, %738) -> (%out.103) -> (%out.101) -> (%out.99) -> (%out.97) %grad_other.12 : Tensor = aten::_grad_sum_to_size(%out.95, %other_size.3) -> (%grad_self.25, %grad_other.12) %837 : Tensor = prim::AutogradAdd(%11, %grad_other.13) %838 : Tensor = prim::AutogradAdd(%10, %grad_self.26) %grad_self.28 : Tensor = prim::GradOf[name="aten::t"](%837) block0(): %grad_self.27 : Tensor = aten::t(%837) -> (%grad_self.27) %grad_self.30 : Tensor = prim::GradOf[name="aten::view"](%838) block0(): %grad_self.29 : Tensor = aten::reshape(%838, %self_size.10) -> (%grad_self.29) %843 : None = prim::GradOf[name="aten::contiguous"](%grad_self.30) block0(): -> (%844) %grad_self.32 : Tensor = prim::GradOf[name="aten::transpose"](%843) block0(): %grad_self.31 : Tensor = aten::transpose(%843, %134, %136) -> (%grad_self.31) %grad_self.34 : Tensor, %grad_other.15 : Tensor = prim::GradOf[name="aten::matmul"](%grad_self.32) block0(): %self_size.12 : int[] = aten::size(%res.15) %other_size.4 : int[] = aten::size(%value) %dim.13 : int = aten::dim(%value) %858 : bool = aten::eq(%dim.13, %134) %out.104 : Tensor = prim::If(%858) block0(): -> (%value) block1(): %860 : bool = aten::eq(%dim.13, %136) %out.105 : Tensor = prim::If(%860) block0(): %out.106 : Tensor = aten::t(%value) -> (%out.106) block1(): %dims.8 : int[] = prim::rangelist(%dim.13) %864 : int = aten::sub(%dim.13, %136) %865 : int[] = aten::_set_item(%dims.8, %144, %864) %866 : int = aten::sub(%dim.13, %134) %867 : int[] = aten::_set_item(%dims.8, %145, %866) %out.107 : Tensor = aten::permute(%value, %dims.8) -> (%out.107) -> (%out.105) %dim1.9 : int = aten::dim(%grad_self.32) %dim2.8 : int = aten::dim(%out.104) %dim_out.8 : int = aten::len(%self_size.12) %872 : bool = aten::eq(%dim1.9, %130) %873 : bool = prim::If(%872) block0(): -> (%151) block1(): %874 : bool = aten::eq(%dim2.8, %130) -> (%874) %out.108 : Tensor = prim::If(%873) block0(): %out.109 : Tensor = aten::mul(%grad_self.32, %out.104) -> (%out.109) block1(): %877 : int = aten::add(%dim1.9, %dim2.8) %878 : bool = aten::eq(%877, %dim_out.8) %out.110 : Tensor = prim::If(%878) block0(): %880 : bool = aten::eq(%dim2.8, %134) %target_dim2.8 : int = prim::If(%880) block0(): -> (%130) block1(): -> (%145) %882 : Tensor = aten::unsqueeze(%grad_self.32, %dim1.9) %883 : Tensor = aten::unsqueeze(%out.104, %target_dim2.8) %out.111 : Tensor = aten::matmul(%882, %883) -> (%out.111) block1(): %885 : int = aten::sub(%dim1.9, %dim2.8) %886 : bool = aten::eq(%dim_out.8, %885) %out.112 : Tensor = prim::If(%886) block0(): %888 : Tensor = aten::unsqueeze(%out.104, %dim2.8) %889 : Tensor = aten::matmul(%grad_self.32, %888) %out.113 : Tensor = aten::squeeze(%889, %144) -> (%out.113) block1(): %891 : int = aten::sub(%dim2.8, %dim1.9) %892 : bool = aten::eq(%dim_out.8, %891) %out.114 : Tensor = prim::If(%892) block0(): %894 : Tensor = aten::unsqueeze(%grad_self.32, %145) %895 : Tensor = aten::matmul(%894, %out.104) %out.115 : Tensor = aten::squeeze(%895, %145) -> (%out.115) block1(): %out.116 : Tensor = aten::matmul(%grad_self.32, %out.104) -> (%out.116) -> (%out.114) -> (%out.112) -> (%out.110) %grad_self.33 : Tensor = aten::_grad_sum_to_size(%out.108, %self_size.12) %dim.12 : int = aten::dim(%res.15) %900 : bool = aten::eq(%dim.12, %134) %out.117 : Tensor = prim::If(%900) block0(): -> (%res.15) block1(): %902 : bool = aten::eq(%dim.12, %136) %out.118 : Tensor = prim::If(%902) block0(): %out.119 : Tensor = aten::t(%res.15) -> (%out.119) block1(): %dims.9 : int[] = prim::rangelist(%dim.12) %906 : int = aten::sub(%dim.12, %136) %907 : int[] = aten::_set_item(%dims.9, %144, %906) %908 : int = aten::sub(%dim.12, %134) %909 : int[] = aten::_set_item(%dims.9, %145, %908) %out.120 : Tensor = aten::permute(%res.15, %dims.9) -> (%out.120) -> (%out.118) %dim1.10 : int = aten::dim(%out.117) %dim2.9 : int = aten::dim(%grad_self.32) %dim_out.9 : int = aten::len(%other_size.4) %914 : bool = aten::eq(%dim1.10, %130) %915 : bool = prim::If(%914) block0(): -> (%151) block1(): %916 : bool = aten::eq(%dim2.9, %130) -> (%916) %out.121 : Tensor = prim::If(%915) block0(): %out.122 : Tensor = aten::mul(%out.117, %grad_self.32) -> (%out.122) block1(): %919 : int = aten::add(%dim1.10, %dim2.9) %920 : bool = aten::eq(%919, %dim_out.9) %out.123 : Tensor = prim::If(%920) block0(): %922 : bool = aten::eq(%dim2.9, %134) %target_dim2.9 : int = prim::If(%922) block0(): -> (%130) block1(): -> (%145) %924 : Tensor = aten::unsqueeze(%out.117, %dim1.10) %925 : Tensor = aten::unsqueeze(%grad_self.32, %target_dim2.9) %out.124 : Tensor = aten::matmul(%924, %925) -> (%out.124) block1(): %927 : int = aten::sub(%dim1.10, %dim2.9) %928 : bool = aten::eq(%dim_out.9, %927) %out.125 : Tensor = prim::If(%928) block0(): %930 : Tensor = aten::unsqueeze(%grad_self.32, %dim2.9) %931 : Tensor = aten::matmul(%out.117, %930) %out.126 : Tensor = aten::squeeze(%931, %144) -> (%out.126) block1(): %933 : int = aten::sub(%dim2.9, %dim1.10) %934 : bool = aten::eq(%dim_out.9, %933) %out.127 : Tensor = prim::If(%934) block0(): %936 : Tensor = aten::unsqueeze(%out.117, %145) %937 : Tensor = aten::matmul(%936, %grad_self.32) %out.128 : Tensor = aten::squeeze(%937, %145) -> (%out.128) block1(): %out.129 : Tensor = aten::matmul(%out.117, %grad_self.32) -> (%out.129) -> (%out.127) -> (%out.125) -> (%out.123) %grad_other.14 : Tensor = aten::_grad_sum_to_size(%out.121, %other_size.4) -> (%grad_self.33, %grad_other.14) %941 : Tensor = prim::AutogradAdd(%6, %grad_other.15) %grad_input.20 : Tensor = prim::GradOf[name="aten::dropout"](%grad_self.34) block0(): %grad_input.19 : Tensor = prim::If(%use_cuda.9) block0(): %p1r.5 : float = aten::div(%174, %p1m.11) %946 : Tensor = aten::type_as(%mask.19, %grad_self.34) %947 : Tensor = aten::mul(%946, %p1r.5) %grad_input.21 : Tensor = aten::mul(%grad_self.34, %947) -> (%grad_input.21) block1(): %949 : Tensor = aten::mul(%grad_self.34, %mask.19) %grad_input.22 : Tensor = aten::div(%949, %p1m.11) -> (%grad_input.22) -> (%grad_input.19) %951 : Tensor = prim::AutogradAdd(%9, %grad_input.20) %grad_self.36 : Tensor = prim::GradOf[name="aten::softmax"](%951) block0(): %grad_self.35 : Tensor = aten::_softmax_backward_data(%951, %input.4, %144, %65) -> (%grad_self.35) %954 : Tensor = prim::AutogradAdd(%8, %grad_self.36) %955 : Tensor = prim::GradOf[name="aten::div"](%954) block0(): %956 : Tensor = aten::div(%954, %146) -> (%956) %grad_self.38 : Tensor, %grad_other.17 : Tensor = prim::GradOf[name="aten::matmul"](%955) block0(): %self_size.13 : int[] = aten::size(%query) %other_size.5 : int[] = aten::size(%64) %dim.15 : int = aten::dim(%64) %968 : bool = aten::eq(%dim.15, %134) %out.130 : Tensor = prim::If(%968) block0(): -> (%64) block1(): %970 : bool = aten::eq(%dim.15, %136) %out.131 : Tensor = prim::If(%970) block0(): %out.132 : Tensor = aten::t(%64) -> (%out.132) block1(): %dims.10 : int[] = prim::rangelist(%dim.15) %974 : int = aten::sub(%dim.15, %136) %975 : int[] = aten::_set_item(%dims.10, %144, %974) %976 : int = aten::sub(%dim.15, %134) %977 : int[] = aten::_set_item(%dims.10, %145, %976) %out.133 : Tensor = aten::permute(%64, %dims.10) -> (%out.133) -> (%out.131) %dim1.13 : int = aten::dim(%955) %dim2.10 : int = aten::dim(%out.130) %dim_out.10 : int = aten::len(%self_size.13) %982 : bool = aten::eq(%dim1.13, %130) %983 : bool = prim::If(%982) block0(): -> (%151) block1(): %984 : bool = aten::eq(%dim2.10, %130) -> (%984) %out.134 : Tensor = prim::If(%983) block0(): %out.135 : Tensor = aten::mul(%955, %out.130) -> (%out.135) block1(): %987 : int = aten::add(%dim1.13, %dim2.10) %988 : bool = aten::eq(%987, %dim_out.10) %out.136 : Tensor = prim::If(%988) block0(): %990 : bool = aten::eq(%dim2.10, %134) %target_dim2.10 : int = prim::If(%990) block0(): -> (%130) block1(): -> (%145) %992 : Tensor = aten::unsqueeze(%955, %dim1.13) %993 : Tensor = aten::unsqueeze(%out.130, %target_dim2.10) %out.137 : Tensor = aten::matmul(%992, %993) -> (%out.137) block1(): %995 : int = aten::sub(%dim1.13, %dim2.10) %996 : bool = aten::eq(%dim_out.10, %995) %out.138 : Tensor = prim::If(%996) block0(): %998 : Tensor = aten::unsqueeze(%out.130, %dim2.10) %999 : Tensor = aten::matmul(%955, %998) %out.139 : Tensor = aten::squeeze(%999, %144) -> (%out.139) block1(): %1001 : int = aten::sub(%dim2.10, %dim1.13) %1002 : bool = aten::eq(%dim_out.10, %1001) %out.140 : Tensor = prim::If(%1002) block0(): %1004 : Tensor = aten::unsqueeze(%955, %145) %1005 : Tensor = aten::matmul(%1004, %out.130) %out.141 : Tensor = aten::squeeze(%1005, %145) -> (%out.141) block1(): %out.142 : Tensor = aten::matmul(%955, %out.130) -> (%out.142) -> (%out.140) -> (%out.138) -> (%out.136) %grad_self.37 : Tensor = aten::_grad_sum_to_size(%out.134, %self_size.13) %dim.16 : int = aten::dim(%query) %1010 : bool = aten::eq(%dim.16, %134) %out.143 : Tensor = prim::If(%1010) block0(): -> (%query) block1(): %1012 : bool = aten::eq(%dim.16, %136) %out.144 : Tensor = prim::If(%1012) block0(): %out.145 : Tensor = aten::t(%query) -> (%out.145) block1(): %dims.11 : int[] = prim::rangelist(%dim.16) %1016 : int = aten::sub(%dim.16, %136) %1017 : int[] = aten::_set_item(%dims.11, %144, %1016) %1018 : int = aten::sub(%dim.16, %134) %1019 : int[] = aten::_set_item(%dims.11, %145, %1018) %out.146 : Tensor = aten::permute(%query, %dims.11) -> (%out.146) -> (%out.144) %dim1.11 : int = aten::dim(%out.143) %dim2.11 : int = aten::dim(%955) %dim_out.11 : int = aten::len(%other_size.5) %1024 : bool = aten::eq(%dim1.11, %130) %1025 : bool = prim::If(%1024) block0(): -> (%151) block1(): %1026 : bool = aten::eq(%dim2.11, %130) -> (%1026) %out.147 : Tensor = prim::If(%1025) block0(): %out.148 : Tensor = aten::mul(%out.143, %955) -> (%out.148) block1(): %1029 : int = aten::add(%dim1.11, %dim2.11) %1030 : bool = aten::eq(%1029, %dim_out.11) %out.149 : Tensor = prim::If(%1030) block0(): %1032 : bool = aten::eq(%dim2.11, %134) %target_dim2.11 : int = prim::If(%1032) block0(): -> (%130) block1(): -> (%145) %1034 : Tensor = aten::unsqueeze(%out.143, %dim1.11) %1035 : Tensor = aten::unsqueeze(%955, %target_dim2.11) %out.150 : Tensor = aten::matmul(%1034, %1035) -> (%out.150) block1(): %1037 : int = aten::sub(%dim1.11, %dim2.11) %1038 : bool = aten::eq(%dim_out.11, %1037) %out.151 : Tensor = prim::If(%1038) block0(): %1040 : Tensor = aten::unsqueeze(%955, %dim2.11) %1041 : Tensor = aten::matmul(%out.143, %1040) %out.152 : Tensor = aten::squeeze(%1041, %144) -> (%out.152) block1(): %1043 : int = aten::sub(%dim2.11, %dim1.11) %1044 : bool = aten::eq(%dim_out.11, %1043) %out.153 : Tensor = prim::If(%1044) block0(): %1046 : Tensor = aten::unsqueeze(%out.143, %145) %1047 : Tensor = aten::matmul(%1046, %955) %out.154 : Tensor = aten::squeeze(%1047, %145) -> (%out.154) block1(): %out.155 : Tensor = aten::matmul(%out.143, %955) -> (%out.155) -> (%out.153) -> (%out.151) -> (%out.149) %grad_other.16 : Tensor = aten::_grad_sum_to_size(%out.147, %other_size.5) -> (%grad_self.37, %grad_other.16) %1051 : Tensor = prim::AutogradAdd(%7, %grad_other.17) %1052 : Tensor = prim::AutogradAdd(%3, %grad_self.38) %grad_self.40 : Tensor = prim::GradOf[name="aten::transpose"](%1051) block0(): %grad_self.39 : Tensor = aten::transpose(%1051, %145, %144) -> (%grad_self.39) %grad_self.42 : Tensor = prim::GradOf[name="aten::transpose"](%941) block0(): %grad_self.41 : Tensor = aten::transpose(%941, %134, %136) -> (%grad_self.41) %grad_self.44 : Tensor = prim::GradOf[name="aten::view"](%grad_self.42) block0(): %grad_self.43 : Tensor = aten::reshape(%grad_self.42, %self_size.14) -> (%grad_self.43) %1059 : Tensor, %1060 : Tensor = prim::GradOf[name="aten::add"](%grad_self.44) block0(): %1061 : Tensor = aten::_grad_sum_to_size(%grad_self.44, %60) %1062 : Tensor = aten::mul(%grad_self.44, %134), scope: BERT/SublayerConnection/Linear %1063 : Tensor = aten::_grad_sum_to_size(%1062, %61), scope: BERT/SublayerConnection/Linear -> (%1061, %1063) %grad_self.46 : Tensor, %grad_other.19 : Tensor = prim::GradOf[name="aten::matmul"](%1059) block0(): %self_size.16 : int[] = aten::size(%res) %other_size.6 : int[] = aten::size(%59) %dim.17 : int = aten::dim(%59) %1075 : bool = aten::eq(%dim.17, %134) %out.156 : Tensor = prim::If(%1075) block0(): -> (%59) block1(): %1077 : bool = aten::eq(%dim.17, %136) %out.157 : Tensor = prim::If(%1077) block0(): %out.158 : Tensor = aten::t(%59) -> (%out.158) block1(): %dims.12 : int[] = prim::rangelist(%dim.17) %1081 : int = aten::sub(%dim.17, %136) %1082 : int[] = aten::_set_item(%dims.12, %144, %1081) %1083 : int = aten::sub(%dim.17, %134) %1084 : int[] = aten::_set_item(%dims.12, %145, %1083) %out.159 : Tensor = aten::permute(%59, %dims.12) -> (%out.159) -> (%out.157) %dim1.16 : int = aten::dim(%1059) %dim2.12 : int = aten::dim(%out.156) %dim_out.12 : int = aten::len(%self_size.16) %1089 : bool = aten::eq(%dim1.16, %130) %1090 : bool = prim::If(%1089) block0(): -> (%151) block1(): %1091 : bool = aten::eq(%dim2.12, %130) -> (%1091) %out.160 : Tensor = prim::If(%1090) block0(): %out.161 : Tensor = aten::mul(%1059, %out.156) -> (%out.161) block1(): %1094 : int = aten::add(%dim1.16, %dim2.12) %1095 : bool = aten::eq(%1094, %dim_out.12) %out.162 : Tensor = prim::If(%1095) block0(): %1097 : bool = aten::eq(%dim2.12, %134) %target_dim2.12 : int = prim::If(%1097) block0(): -> (%130) block1(): -> (%145) %1099 : Tensor = aten::unsqueeze(%1059, %dim1.16) %1100 : Tensor = aten::unsqueeze(%out.156, %target_dim2.12) %out.163 : Tensor = aten::matmul(%1099, %1100) -> (%out.163) block1(): %1102 : int = aten::sub(%dim1.16, %dim2.12) %1103 : bool = aten::eq(%dim_out.12, %1102) %out.164 : Tensor = prim::If(%1103) block0(): %1105 : Tensor = aten::unsqueeze(%out.156, %dim2.12) %1106 : Tensor = aten::matmul(%1059, %1105) %out.165 : Tensor = aten::squeeze(%1106, %144) -> (%out.165) block1(): %1108 : int = aten::sub(%dim2.12, %dim1.16) %1109 : bool = aten::eq(%dim_out.12, %1108) %out.166 : Tensor = prim::If(%1109) block0(): %1111 : Tensor = aten::unsqueeze(%1059, %145) %1112 : Tensor = aten::matmul(%1111, %out.156) %out.167 : Tensor = aten::squeeze(%1112, %145) -> (%out.167) block1(): %out.168 : Tensor = aten::matmul(%1059, %out.156) -> (%out.168) -> (%out.166) -> (%out.164) -> (%out.162) %grad_self.45 : Tensor = aten::_grad_sum_to_size(%out.160, %self_size.16) %dim.18 : int = aten::dim(%res) %1117 : bool = aten::eq(%dim.18, %134) %out.169 : Tensor = prim::If(%1117) block0(): -> (%res) block1(): %1119 : bool = aten::eq(%dim.18, %136) %out.170 : Tensor = prim::If(%1119) block0(): %out.171 : Tensor = aten::t(%res) -> (%out.171) block1(): %dims.13 : int[] = prim::rangelist(%dim.18) %1123 : int = aten::sub(%dim.18, %136) %1124 : int[] = aten::_set_item(%dims.13, %144, %1123) %1125 : int = aten::sub(%dim.18, %134) %1126 : int[] = aten::_set_item(%dims.13, %145, %1125) %out.172 : Tensor = aten::permute(%res, %dims.13) -> (%out.172) -> (%out.170) %dim1.15 : int = aten::dim(%out.169) %dim2.13 : int = aten::dim(%1059) %dim_out.13 : int = aten::len(%other_size.6) %1131 : bool = aten::eq(%dim1.15, %130) %1132 : bool = prim::If(%1131) block0(): -> (%151) block1(): %1133 : bool = aten::eq(%dim2.13, %130) -> (%1133) %out.173 : Tensor = prim::If(%1132) block0(): %out.174 : Tensor = aten::mul(%out.169, %1059) -> (%out.174) block1(): %1136 : int = aten::add(%dim1.15, %dim2.13) %1137 : bool = aten::eq(%1136, %dim_out.13) %out.175 : Tensor = prim::If(%1137) block0(): %1139 : bool = aten::eq(%dim2.13, %134) %target_dim2.13 : int = prim::If(%1139) block0(): -> (%130) block1(): -> (%145) %1141 : Tensor = aten::unsqueeze(%out.169, %dim1.15) %1142 : Tensor = aten::unsqueeze(%1059, %target_dim2.13) %out.176 : Tensor = aten::matmul(%1141, %1142) -> (%out.176) block1(): %1144 : int = aten::sub(%dim1.15, %dim2.13) %1145 : bool = aten::eq(%dim_out.13, %1144) %out.177 : Tensor = prim::If(%1145) block0(): %1147 : Tensor = aten::unsqueeze(%1059, %dim2.13) %1148 : Tensor = aten::matmul(%out.169, %1147) %out.178 : Tensor = aten::squeeze(%1148, %144) -> (%out.178) block1(): %1150 : int = aten::sub(%dim2.13, %dim1.15) %1151 : bool = aten::eq(%dim_out.13, %1150) %out.179 : Tensor = prim::If(%1151) block0(): %1153 : Tensor = aten::unsqueeze(%out.169, %145) %1154 : Tensor = aten::matmul(%1153, %1059) %out.180 : Tensor = aten::squeeze(%1154, %145) -> (%out.180) block1(): %out.181 : Tensor = aten::matmul(%out.169, %1059) -> (%out.181) -> (%out.179) -> (%out.177) -> (%out.175) %grad_other.18 : Tensor = aten::_grad_sum_to_size(%out.173, %other_size.6) -> (%grad_self.45, %grad_other.18) %1158 : Tensor = prim::AutogradAdd(%5, %grad_other.19) %1159 : Tensor = prim::AutogradAdd(%590, %grad_self.46) %grad_self.48 : Tensor = prim::GradOf[name="aten::t"](%1158) block0(): %grad_self.47 : Tensor = aten::t(%1158) -> (%grad_self.47) %grad_self.50 : Tensor = prim::GradOf[name="aten::transpose"](%grad_self.40) block0(): %grad_self.49 : Tensor = aten::transpose(%grad_self.40, %134, %136) -> (%grad_self.49) %grad_self.52 : Tensor = prim::GradOf[name="aten::view"](%grad_self.50) block0(): %grad_self.51 : Tensor = aten::reshape(%grad_self.50, %self_size.17) -> (%grad_self.51) %1166 : Tensor, %1167 : Tensor = prim::GradOf[name="aten::add"](%grad_self.52) block0(): %1168 : Tensor = aten::_grad_sum_to_size(%grad_self.52, %56) %1169 : Tensor = aten::mul(%grad_self.52, %134), scope: BERT/SublayerConnection/Linear %1170 : Tensor = aten::_grad_sum_to_size(%1169, %57), scope: BERT/SublayerConnection/Linear -> (%1168, %1170) %grad_self.54 : Tensor, %grad_other.21 : Tensor = prim::GradOf[name="aten::matmul"](%1166) block0(): %self_size.19 : int[] = aten::size(%res) %other_size.7 : int[] = aten::size(%55) %dim.19 : int = aten::dim(%55) %1182 : bool = aten::eq(%dim.19, %134) %out.182 : Tensor = prim::If(%1182) block0(): -> (%55) block1(): %1184 : bool = aten::eq(%dim.19, %136) %out.183 : Tensor = prim::If(%1184) block0(): %out.184 : Tensor = aten::t(%55) -> (%out.184) block1(): %dims.14 : int[] = prim::rangelist(%dim.19) %1188 : int = aten::sub(%dim.19, %136) %1189 : int[] = aten::_set_item(%dims.14, %144, %1188) %1190 : int = aten::sub(%dim.19, %134) %1191 : int[] = aten::_set_item(%dims.14, %145, %1190) %out.185 : Tensor = aten::permute(%55, %dims.14) -> (%out.185) -> (%out.183) %dim1.19 : int = aten::dim(%1166) %dim2.14 : int = aten::dim(%out.182) %dim_out.14 : int = aten::len(%self_size.19) %1196 : bool = aten::eq(%dim1.19, %130) %1197 : bool = prim::If(%1196) block0(): -> (%151) block1(): %1198 : bool = aten::eq(%dim2.14, %130) -> (%1198) %out.186 : Tensor = prim::If(%1197) block0(): %out.187 : Tensor = aten::mul(%1166, %out.182) -> (%out.187) block1(): %1201 : int = aten::add(%dim1.19, %dim2.14) %1202 : bool = aten::eq(%1201, %dim_out.14) %out.188 : Tensor = prim::If(%1202) block0(): %1204 : bool = aten::eq(%dim2.14, %134) %target_dim2.14 : int = prim::If(%1204) block0(): -> (%130) block1(): -> (%145) %1206 : Tensor = aten::unsqueeze(%1166, %dim1.19) %1207 : Tensor = aten::unsqueeze(%out.182, %target_dim2.14) %out.189 : Tensor = aten::matmul(%1206, %1207) -> (%out.189) block1(): %1209 : int = aten::sub(%dim1.19, %dim2.14) %1210 : bool = aten::eq(%dim_out.14, %1209) %out.190 : Tensor = prim::If(%1210) block0(): %1212 : Tensor = aten::unsqueeze(%out.182, %dim2.14) %1213 : Tensor = aten::matmul(%1166, %1212) %out.191 : Tensor = aten::squeeze(%1213, %144) -> (%out.191) block1(): %1215 : int = aten::sub(%dim2.14, %dim1.19) %1216 : bool = aten::eq(%dim_out.14, %1215) %out.192 : Tensor = prim::If(%1216) block0(): %1218 : Tensor = aten::unsqueeze(%1166, %145) %1219 : Tensor = aten::matmul(%1218, %out.182) %out.193 : Tensor = aten::squeeze(%1219, %145) -> (%out.193) block1(): %out.194 : Tensor = aten::matmul(%1166, %out.182) -> (%out.194) -> (%out.192) -> (%out.190) -> (%out.188) %grad_self.53 : Tensor = aten::_grad_sum_to_size(%out.186, %self_size.19) %dim.20 : int = aten::dim(%res) %1224 : bool = aten::eq(%dim.20, %134) %out.195 : Tensor = prim::If(%1224) block0(): -> (%res) block1(): %1226 : bool = aten::eq(%dim.20, %136) %out.196 : Tensor = prim::If(%1226) block0(): %out.197 : Tensor = aten::t(%res) -> (%out.197) block1(): %dims.15 : int[] = prim::rangelist(%dim.20) %1230 : int = aten::sub(%dim.20, %136) %1231 : int[] = aten::_set_item(%dims.15, %144, %1230) %1232 : int = aten::sub(%dim.20, %134) %1233 : int[] = aten::_set_item(%dims.15, %145, %1232) %out.198 : Tensor = aten::permute(%res, %dims.15) -> (%out.198) -> (%out.196) %dim1.18 : int = aten::dim(%out.195) %dim2.15 : int = aten::dim(%1166) %dim_out.15 : int = aten::len(%other_size.7) %1238 : bool = aten::eq(%dim1.18, %130) %1239 : bool = prim::If(%1238) block0(): -> (%151) block1(): %1240 : bool = aten::eq(%dim2.15, %130) -> (%1240) %out.199 : Tensor = prim::If(%1239) block0(): %out.200 : Tensor = aten::mul(%out.195, %1166) -> (%out.200) block1(): %1243 : int = aten::add(%dim1.18, %dim2.15) %1244 : bool = aten::eq(%1243, %dim_out.15) %out.201 : Tensor = prim::If(%1244) block0(): %1246 : bool = aten::eq(%dim2.15, %134) %target_dim2.15 : int = prim::If(%1246) block0(): -> (%130) block1(): -> (%145) %1248 : Tensor = aten::unsqueeze(%out.195, %dim1.18) %1249 : Tensor = aten::unsqueeze(%1166, %target_dim2.15) %out.202 : Tensor = aten::matmul(%1248, %1249) -> (%out.202) block1(): %1251 : int = aten::sub(%dim1.18, %dim2.15) %1252 : bool = aten::eq(%dim_out.15, %1251) %out.203 : Tensor = prim::If(%1252) block0(): %1254 : Tensor = aten::unsqueeze(%1166, %dim2.15) %1255 : Tensor = aten::matmul(%out.195, %1254) %out.204 : Tensor = aten::squeeze(%1255, %144) -> (%out.204) block1(): %1257 : int = aten::sub(%dim2.15, %dim1.18) %1258 : bool = aten::eq(%dim_out.15, %1257) %out.205 : Tensor = prim::If(%1258) block0(): %1260 : Tensor = aten::unsqueeze(%out.195, %145) %1261 : Tensor = aten::matmul(%1260, %1166) %out.206 : Tensor = aten::squeeze(%1261, %145) -> (%out.206) block1(): %out.207 : Tensor = aten::matmul(%out.195, %1166) -> (%out.207) -> (%out.205) -> (%out.203) -> (%out.201) %grad_other.20 : Tensor = aten::_grad_sum_to_size(%out.199, %other_size.7) -> (%grad_self.53, %grad_other.20) %1265 : Tensor = prim::AutogradAdd(%4, %grad_other.21) %1266 : Tensor = prim::AutogradAdd(%1159, %grad_self.54) %grad_self.56 : Tensor = prim::GradOf[name="aten::t"](%1265) block0(): %grad_self.55 : Tensor = aten::t(%1265) -> (%grad_self.55) %grad_self.58 : Tensor = prim::GradOf[name="aten::transpose"](%1052) block0(): %grad_self.57 : Tensor = aten::transpose(%1052, %134, %136) -> (%grad_self.57) %grad_self.60 : Tensor = prim::GradOf[name="aten::view"](%grad_self.58) block0(): %grad_self.59 : Tensor = aten::reshape(%grad_self.58, %self_size.20) -> (%grad_self.59) %1273 : Tensor, %1274 : Tensor = prim::GradOf[name="aten::add"](%grad_self.60) block0(): %1275 : Tensor = aten::_grad_sum_to_size(%grad_self.60, %51) %1276 : Tensor = aten::mul(%grad_self.60, %134), scope: BERT/SublayerConnection/Linear %1277 : Tensor = aten::_grad_sum_to_size(%1276, %52), scope: BERT/SublayerConnection/Linear -> (%1275, %1277) %grad_self.62 : Tensor, %grad_other : Tensor = prim::GradOf[name="aten::matmul"](%1273) block0(): %self_size : int[] = aten::size(%res) %other_size : int[] = aten::size(%50) %dim.1 : int = aten::dim(%50) %1289 : bool = aten::eq(%dim.1, %134) %out.11 : Tensor = prim::If(%1289) block0(): -> (%50) block1(): %1291 : bool = aten::eq(%dim.1, %136) %out.9 : Tensor = prim::If(%1291) block0(): %out.12 : Tensor = aten::t(%50) -> (%out.12) block1(): %dims.1 : int[] = prim::rangelist(%dim.1) %1295 : int = aten::sub(%dim.1, %136) %1296 : int[] = aten::_set_item(%dims.1, %144, %1295) %1297 : int = aten::sub(%dim.1, %134) %1298 : int[] = aten::_set_item(%dims.1, %145, %1297) %out.10 : Tensor = aten::permute(%50, %dims.1) -> (%out.10) -> (%out.9) %dim1.1 : int = aten::dim(%1273) %dim2.1 : int = aten::dim(%out.11) %dim_out.1 : int = aten::len(%self_size) %1303 : bool = aten::eq(%dim1.1, %130) %1304 : bool = prim::If(%1303) block0(): -> (%151) block1(): %1305 : bool = aten::eq(%dim2.1, %130) -> (%1305) %out.13 : Tensor = prim::If(%1304) block0(): %out.15 : Tensor = aten::mul(%1273, %out.11) -> (%out.15) block1(): %1308 : int = aten::add(%dim1.1, %dim2.1) %1309 : bool = aten::eq(%1308, %dim_out.1) %out.19 : Tensor = prim::If(%1309) block0(): %1311 : bool = aten::eq(%dim2.1, %134) %target_dim2.1 : int = prim::If(%1311) block0(): -> (%130) block1(): -> (%145) %1313 : Tensor = aten::unsqueeze(%1273, %dim1.1) %1314 : Tensor = aten::unsqueeze(%out.11, %target_dim2.1) %out.16 : Tensor = aten::matmul(%1313, %1314) -> (%out.16) block1(): %1316 : int = aten::sub(%dim1.1, %dim2.1) %1317 : bool = aten::eq(%dim_out.1, %1316) %out.21 : Tensor = prim::If(%1317) block0(): %1319 : Tensor = aten::unsqueeze(%out.11, %dim2.1) %1320 : Tensor = aten::matmul(%1273, %1319) %out.14 : Tensor = aten::squeeze(%1320, %144) -> (%out.14) block1(): %1322 : int = aten::sub(%dim2.1, %dim1.1) %1323 : bool = aten::eq(%dim_out.1, %1322) %out.23 : Tensor = prim::If(%1323) block0(): %1325 : Tensor = aten::unsqueeze(%1273, %145) %1326 : Tensor = aten::matmul(%1325, %out.11) %out.24 : Tensor = aten::squeeze(%1326, %145) -> (%out.24) block1(): %out.25 : Tensor = aten::matmul(%1273, %out.11) -> (%out.25) -> (%out.23) -> (%out.21) -> (%out.19) %grad_self.61 : Tensor = aten::_grad_sum_to_size(%out.13, %self_size) %dim : int = aten::dim(%res) %1331 : bool = aten::eq(%dim, %134) %out.17 : Tensor = prim::If(%1331) block0(): -> (%res) block1(): %1333 : bool = aten::eq(%dim, %136) %out.22 : Tensor = prim::If(%1333) block0(): %out.18 : Tensor = aten::t(%res) -> (%out.18) block1(): %dims : int[] = prim::rangelist(%dim) %1337 : int = aten::sub(%dim, %136) %1338 : int[] = aten::_set_item(%dims, %144, %1337) %1339 : int = aten::sub(%dim, %134) %1340 : int[] = aten::_set_item(%dims, %145, %1339) %out.20 : Tensor = aten::permute(%res, %dims) -> (%out.20) -> (%out.22) %dim1 : int = aten::dim(%out.17) %dim2 : int = aten::dim(%1273) %dim_out : int = aten::len(%other_size) %1345 : bool = aten::eq(%dim1, %130) %1346 : bool = prim::If(%1345) block0(): -> (%151) block1(): %1347 : bool = aten::eq(%dim2, %130) -> (%1347) %out : Tensor = prim::If(%1346) block0(): %out.1 : Tensor = aten::mul(%out.17, %1273) -> (%out.1) block1(): %1350 : int = aten::add(%dim1, %dim2) %1351 : bool = aten::eq(%1350, %dim_out) %out.8 : Tensor = prim::If(%1351) block0(): %1353 : bool = aten::eq(%dim2, %134) %target_dim2 : int = prim::If(%1353) block0(): -> (%130) block1(): -> (%145) %1355 : Tensor = aten::unsqueeze(%out.17, %dim1) %1356 : Tensor = aten::unsqueeze(%1273, %target_dim2) %out.2 : Tensor = aten::matmul(%1355, %1356) -> (%out.2) block1(): %1358 : int = aten::sub(%dim1, %dim2) %1359 : bool = aten::eq(%dim_out, %1358) %out.7 : Tensor = prim::If(%1359) block0(): %1361 : Tensor = aten::unsqueeze(%1273, %dim2) %1362 : Tensor = aten::matmul(%out.17, %1361) %out.3 : Tensor = aten::squeeze(%1362, %144) -> (%out.3) block1(): %1364 : int = aten::sub(%dim2, %dim1) %1365 : bool = aten::eq(%dim_out, %1364) %out.6 : Tensor = prim::If(%1365) block0(): %1367 : Tensor = aten::unsqueeze(%out.17, %145) %1368 : Tensor = aten::matmul(%1367, %1273) %out.4 : Tensor = aten::squeeze(%1368, %145) -> (%out.4) block1(): %out.5 : Tensor = aten::matmul(%out.17, %1273) -> (%out.5) -> (%out.6) -> (%out.7) -> (%out.8) %grad_other.22 : Tensor = aten::_grad_sum_to_size(%out, %other_size) -> (%grad_self.61, %grad_other.22) %1372 : Tensor = prim::AutogradAdd(%2, %grad_other) %1373 : Tensor = prim::AutogradAdd(%1266, %grad_self.62) %grad_self : Tensor = prim::GradOf[name="aten::t"](%1372) block0(): %grad_self.63 : Tensor = aten::t(%1372) -> (%grad_self.63) %grad_input : Tensor = prim::GradOf[name="aten::dropout"](%1373) block0(): %grad_input.23 : Tensor = prim::If(%use_cuda.11) block0(): %p1r : float = aten::div(%174, %p1m.11) %1380 : Tensor = aten::type_as(%mask.23, %1373) %1381 : Tensor = aten::mul(%1380, %p1r) %grad_input.1 : Tensor = aten::mul(%1373, %1381) -> (%grad_input.1) block1(): %1383 : Tensor = aten::mul(%1373, %mask.23) %grad_input.2 : Tensor = aten::div(%1383, %p1m.11) -> (%grad_input.2) -> (%grad_input.23) %1385 : Tensor = prim::AutogradAdd(%1, %grad_input) %1386 : Tensor, %1387 : Tensor = prim::GradOf[name="aten::add"](%1385) block0(): %1388 : Tensor = aten::_grad_sum_to_size(%1385, %40) %1389 : Tensor = aten::mul(%1385, %134), scope: BERT/BERTEmbedding[embedding] %1390 : Tensor = aten::_grad_sum_to_size(%1389, %41), scope: BERT/BERTEmbedding[embedding] -> (%1388, %1390) %grad_weight.2 : Tensor = prim::GradOf[name="aten::embedding"](%1387) block0(): %grad_weight.1 : Tensor = aten::embedding_backward(%1387, %input.1, %weight_size_0.1, %130, %128, %128) -> (%grad_weight.1) %1393 : Tensor = prim::GradOf[name="aten::add"](%1386) block0(): %1394 : Tensor = aten::_grad_sum_to_size(%1386, %38) -> (%1394) %grad_weight : Tensor = prim::GradOf[name="aten::embedding"](%1393) block0(): %grad_weight.3 : Tensor = aten::embedding_backward(%1393, %x.1, %weight_size_0.3, %130, %128, %128) -> (%grad_weight.3) return (%grad_weight, %grad_weight.2, %grad_self, %1274, %grad_self.56, %1167, %grad_self.48, %1060, %grad_self.28, %739, %grad_self.18, %487, %grad_self.10, %332, %grad_self.20, %606, %grad_self.2, %199) =================== CONNECTIONS =================== df_input_vjps: [0, 6, 14, 18, 19, 23, 27, 28, 29, 30, 34, 36, 39, 42, 44, 45, 46, 49, 53, 54, 57, 58, 60, 61, 62, 66, 69, 71, 73, 74, 75, 78, 82] df_input_captured_inputs: [0, 1, 17, 19] df_input_captured_outputs: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84]