import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda


@triton.jit
def triton_poi_fused_add_div_mul_0(in_out_ptr0, in_ptr0, xnumel, XBLOCK: tl
    .constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 16
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (384 + x2), xmask)
    tmp9 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp17 = tl.load(in_ptr0 + (192 + x2), xmask)
    tmp23 = tl.load(in_ptr0 + (448 + x2), xmask)
    tmp25 = tl.load(in_ptr0 + (64 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp29 = tl.load(in_ptr0 + (65 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp33 = tl.load(in_ptr0 + (66 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp37 = tl.load(in_ptr0 + (256 + x2), xmask)
    tmp43 = tl.load(in_ptr0 + (512 + x2), xmask)
    tmp45 = tl.load(in_ptr0 + (128 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp49 = tl.load(in_ptr0 + (129 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp53 = tl.load(in_ptr0 + (130 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp58 = tl.load(in_ptr0 + (320 + x2), xmask)
    tmp1 = 0.0
    tmp2 = tmp0 * tmp1
    tmp4 = -1.0
    tmp5 = tmp3 + tmp4
    tmp6 = tmp5 * tmp0
    tmp7 = tmp2 + tmp6
    tmp8 = tmp3 + tmp1
    tmp10 = tmp8 * tmp9
    tmp11 = tmp7 + tmp10
    tmp12 = 1.0
    tmp13 = tmp3 + tmp12
    tmp15 = tmp13 * tmp14
    tmp16 = tmp11 + tmp15
    tmp18 = tmp17 * tmp12
    tmp19 = tmp18 + tmp12
    tmp20 = 3.0
    tmp21 = tmp19 * tmp20
    tmp22 = tmp16 / tmp21
    tmp24 = tmp23 + tmp4
    tmp26 = tmp24 * tmp25
    tmp27 = tmp2 + tmp26
    tmp28 = tmp23 + tmp1
    tmp30 = tmp28 * tmp29
    tmp31 = tmp27 + tmp30
    tmp32 = tmp23 + tmp12
    tmp34 = tmp32 * tmp33
    tmp35 = tmp31 + tmp34
    tmp36 = tmp35 / tmp21
    tmp38 = tmp37 * tmp12
    tmp39 = tmp38 + tmp12
    tmp40 = tmp39 * tmp20
    tmp41 = tmp36 / tmp40
    tmp42 = tmp22 + tmp41
    tmp44 = tmp43 + tmp4
    tmp46 = tmp44 * tmp45
    tmp47 = tmp2 + tmp46
    tmp48 = tmp43 + tmp1
    tmp50 = tmp48 * tmp49
    tmp51 = tmp47 + tmp50
    tmp52 = tmp43 + tmp12
    tmp54 = tmp52 * tmp53
    tmp55 = tmp51 + tmp54
    tmp56 = tmp55 / tmp21
    tmp57 = tmp56 / tmp40
    tmp59 = tmp58 * tmp12
    tmp60 = tmp59 + tmp12
    tmp61 = tmp60 * tmp20
    tmp62 = tmp57 / tmp61
    tmp63 = tmp42 + tmp62
    tmp64 = 99.0
    tmp65 = tmp63 * tmp64
    tl.store(in_out_ptr0 + x2, tmp65, xmask)


def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (9, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        buf2 = buf0
        del buf0
        get_raw_stream(0)
        triton_poi_fused_add_div_mul_0[grid(64)](buf2, arg0_1, 64, XBLOCK=
            64, num_warps=1, num_stages=1)
        del arg0_1
    return buf2,


class SSRLayerNew(nn.Module):

    def __init__(self):
        super(SSRLayerNew, self).__init__()

    def forward(self, input_0):
        arg0_1 = input_0
        output = call([arg0_1])
        return output[0]


Measured latency_ms: 0.013872