import torch
from torch._inductor.select_algorithm import extern_kernels
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
from torch._inductor.runtime.triton_helpers import libdevice
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
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_poi_fused_mv_0(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4,
    out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5, out_ptr6,
    out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12,
    out_ptr13, out_ptr14, out_ptr15, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + 0)
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK])
    tmp4 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + 4)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr1 + 8)
    tmp11 = tl.broadcast_to(tmp10, [XBLOCK])
    tmp14 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp15 = tl.load(in_ptr1 + 12)
    tmp16 = tl.broadcast_to(tmp15, [XBLOCK])
    tmp19 = tl.load(in_ptr1 + 1)
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp22 = tl.load(in_ptr1 + 5)
    tmp23 = tl.broadcast_to(tmp22, [XBLOCK])
    tmp26 = tl.load(in_ptr1 + 9)
    tmp27 = tl.broadcast_to(tmp26, [XBLOCK])
    tmp30 = tl.load(in_ptr1 + 13)
    tmp31 = tl.broadcast_to(tmp30, [XBLOCK])
    tmp34 = tl.load(in_ptr1 + 2)
    tmp35 = tl.broadcast_to(tmp34, [XBLOCK])
    tmp37 = tl.load(in_ptr1 + 6)
    tmp38 = tl.broadcast_to(tmp37, [XBLOCK])
    tmp41 = tl.load(in_ptr1 + 10)
    tmp42 = tl.broadcast_to(tmp41, [XBLOCK])
    tmp45 = tl.load(in_ptr1 + 14)
    tmp46 = tl.broadcast_to(tmp45, [XBLOCK])
    tmp49 = tl.load(in_ptr1 + 3)
    tmp50 = tl.broadcast_to(tmp49, [XBLOCK])
    tmp52 = tl.load(in_ptr1 + 7)
    tmp53 = tl.broadcast_to(tmp52, [XBLOCK])
    tmp56 = tl.load(in_ptr1 + 11)
    tmp57 = tl.broadcast_to(tmp56, [XBLOCK])
    tmp60 = tl.load(in_ptr1 + 15)
    tmp61 = tl.broadcast_to(tmp60, [XBLOCK])
    tmp64 = tl.load(in_ptr2 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp66 = tl.load(in_ptr2 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp69 = tl.load(in_ptr2 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp72 = tl.load(in_ptr2 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp96 = tl.load(in_ptr3 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp98 = tl.load(in_ptr3 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp101 = tl.load(in_ptr3 + (2 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp104 = tl.load(in_ptr3 + (3 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp128 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp130 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp133 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp136 = tl.load(in_ptr4 + (3 + 4 * x0), xmask, eviction_policy=
        'evict_last')
    tmp3 = tmp0 * tmp2
    tmp7 = tmp4 * tmp6
    tmp8 = tmp3 + tmp7
    tmp12 = tmp9 * tmp11
    tmp13 = tmp8 + tmp12
    tmp17 = tmp14 * tmp16
    tmp18 = tmp13 + tmp17
    tmp21 = tmp0 * tmp20
    tmp24 = tmp4 * tmp23
    tmp25 = tmp21 + tmp24
    tmp28 = tmp9 * tmp27
    tmp29 = tmp25 + tmp28
    tmp32 = tmp14 * tmp31
    tmp33 = tmp29 + tmp32
    tmp36 = tmp0 * tmp35
    tmp39 = tmp4 * tmp38
    tmp40 = tmp36 + tmp39
    tmp43 = tmp9 * tmp42
    tmp44 = tmp40 + tmp43
    tmp47 = tmp14 * tmp46
    tmp48 = tmp44 + tmp47
    tmp51 = tmp0 * tmp50
    tmp54 = tmp4 * tmp53
    tmp55 = tmp51 + tmp54
    tmp58 = tmp9 * tmp57
    tmp59 = tmp55 + tmp58
    tmp62 = tmp14 * tmp61
    tmp63 = tmp59 + tmp62
    tmp65 = tmp64 * tmp2
    tmp67 = tmp66 * tmp6
    tmp68 = tmp65 + tmp67
    tmp70 = tmp69 * tmp11
    tmp71 = tmp68 + tmp70
    tmp73 = tmp72 * tmp16
    tmp74 = tmp71 + tmp73
    tmp75 = tmp64 * tmp20
    tmp76 = tmp66 * tmp23
    tmp77 = tmp75 + tmp76
    tmp78 = tmp69 * tmp27
    tmp79 = tmp77 + tmp78
    tmp80 = tmp72 * tmp31
    tmp81 = tmp79 + tmp80
    tmp82 = tmp64 * tmp35
    tmp83 = tmp66 * tmp38
    tmp84 = tmp82 + tmp83
    tmp85 = tmp69 * tmp42
    tmp86 = tmp84 + tmp85
    tmp87 = tmp72 * tmp46
    tmp88 = tmp86 + tmp87
    tmp89 = tmp64 * tmp50
    tmp90 = tmp66 * tmp53
    tmp91 = tmp89 + tmp90
    tmp92 = tmp69 * tmp57
    tmp93 = tmp91 + tmp92
    tmp94 = tmp72 * tmp61
    tmp95 = tmp93 + tmp94
    tmp97 = tmp96 * tmp2
    tmp99 = tmp98 * tmp6
    tmp100 = tmp97 + tmp99
    tmp102 = tmp101 * tmp11
    tmp103 = tmp100 + tmp102
    tmp105 = tmp104 * tmp16
    tmp106 = tmp103 + tmp105
    tmp107 = tmp96 * tmp20
    tmp108 = tmp98 * tmp23
    tmp109 = tmp107 + tmp108
    tmp110 = tmp101 * tmp27
    tmp111 = tmp109 + tmp110
    tmp112 = tmp104 * tmp31
    tmp113 = tmp111 + tmp112
    tmp114 = tmp96 * tmp35
    tmp115 = tmp98 * tmp38
    tmp116 = tmp114 + tmp115
    tmp117 = tmp101 * tmp42
    tmp118 = tmp116 + tmp117
    tmp119 = tmp104 * tmp46
    tmp120 = tmp118 + tmp119
    tmp121 = tmp96 * tmp50
    tmp122 = tmp98 * tmp53
    tmp123 = tmp121 + tmp122
    tmp124 = tmp101 * tmp57
    tmp125 = tmp123 + tmp124
    tmp126 = tmp104 * tmp61
    tmp127 = tmp125 + tmp126
    tmp129 = tmp128 * tmp2
    tmp131 = tmp130 * tmp6
    tmp132 = tmp129 + tmp131
    tmp134 = tmp133 * tmp11
    tmp135 = tmp132 + tmp134
    tmp137 = tmp136 * tmp16
    tmp138 = tmp135 + tmp137
    tmp139 = tmp128 * tmp20
    tmp140 = tmp130 * tmp23
    tmp141 = tmp139 + tmp140
    tmp142 = tmp133 * tmp27
    tmp143 = tmp141 + tmp142
    tmp144 = tmp136 * tmp31
    tmp145 = tmp143 + tmp144
    tmp146 = tmp128 * tmp35
    tmp147 = tmp130 * tmp38
    tmp148 = tmp146 + tmp147
    tmp149 = tmp133 * tmp42
    tmp150 = tmp148 + tmp149
    tmp151 = tmp136 * tmp46
    tmp152 = tmp150 + tmp151
    tmp153 = tmp128 * tmp50
    tmp154 = tmp130 * tmp53
    tmp155 = tmp153 + tmp154
    tmp156 = tmp133 * tmp57
    tmp157 = tmp155 + tmp156
    tmp158 = tmp136 * tmp61
    tmp159 = tmp157 + tmp158
    tl.store(out_ptr0 + x0, tmp18, xmask)
    tl.store(out_ptr1 + x0, tmp33, xmask)
    tl.store(out_ptr2 + x0, tmp48, xmask)
    tl.store(out_ptr3 + x0, tmp63, xmask)
    tl.store(out_ptr4 + x0, tmp74, xmask)
    tl.store(out_ptr5 + x0, tmp81, xmask)
    tl.store(out_ptr6 + x0, tmp88, xmask)
    tl.store(out_ptr7 + x0, tmp95, xmask)
    tl.store(out_ptr8 + x0, tmp106, xmask)
    tl.store(out_ptr9 + x0, tmp113, xmask)
    tl.store(out_ptr10 + x0, tmp120, xmask)
    tl.store(out_ptr11 + x0, tmp127, xmask)
    tl.store(out_ptr12 + x0, tmp138, xmask)
    tl.store(out_ptr13 + x0, tmp145, xmask)
    tl.store(out_ptr14 + x0, tmp152, xmask)
    tl.store(out_ptr15 + x0, tmp159, xmask)


@triton.jit
def triton_poi_fused_add_mul_mv_sigmoid_tanh_1(in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10,
    in_ptr11, in_ptr12, out_ptr0, out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = xindex // 4
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + x0, xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr5 + x1, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + x1, xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr7 + x0, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + x1, xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr9 + x1, xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + x0, xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + x1, xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr12 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(out_ptr0 + x2, tmp21, xmask)
    tl.store(out_ptr1 + x2, tmp29, xmask)


@triton.jit
def triton_poi_fused_add_mul_mv_sigmoid_tanh_2(in_out_ptr0, in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8,
    in_ptr9, in_ptr10, in_ptr11, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, xmask)
    tmp3 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + x0, xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + x2, xmask)
    tmp9 = tl.load(in_ptr5 + x1, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_out_ptr0 + x2, xmask)
    tmp14 = tl.load(in_ptr6 + x0, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr7 + x2, xmask)
    tmp17 = tl.load(in_ptr8 + x1, xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr9 + x0, xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr10 + x2, xmask)
    tmp26 = tl.load(in_ptr11 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(in_out_ptr0 + x2, tmp21, xmask)
    tl.store(out_ptr0 + x2, tmp29, xmask)


@triton.jit
def triton_poi_fused_add_mul_mv_sigmoid_tanh_3(in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10,
    in_ptr11, in_ptr12, out_ptr0, out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, xmask)
    tmp3 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + x0, xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + x2, xmask)
    tmp9 = tl.load(in_ptr5 + x1, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + x2, xmask)
    tmp14 = tl.load(in_ptr7 + x0, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + x2, xmask)
    tmp17 = tl.load(in_ptr9 + x1, xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + x0, xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + x2, xmask)
    tmp26 = tl.load(in_ptr12 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(out_ptr0 + x2, tmp21, xmask)
    tl.store(out_ptr1 + x2, tmp29, xmask)


@triton.jit
def triton_poi_fused_add_mul_mv_sigmoid_tanh_4(in_out_ptr0, in_ptr0,
    in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8,
    in_ptr9, in_ptr10, in_ptr11, in_ptr12, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + x2, xmask)
    tmp3 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr3 + x0, xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr4 + x2, xmask)
    tmp9 = tl.load(in_ptr5 + x1, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr6 + x2, xmask)
    tmp14 = tl.load(in_ptr7 + x0, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr8 + x2, xmask)
    tmp17 = tl.load(in_ptr9 + x1, xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr10 + x0, xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr11 + x2, xmask)
    tmp26 = tl.load(in_ptr12 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = libdevice.tanh(tmp4)
    tmp8 = tmp6 + tmp7
    tmp10 = tmp8 + tmp9
    tmp11 = tl.sigmoid(tmp10)
    tmp12 = tmp5 * tmp11
    tmp16 = tmp14 + tmp15
    tmp18 = tmp16 + tmp17
    tmp19 = tl.sigmoid(tmp18)
    tmp20 = tmp13 * tmp19
    tmp21 = tmp12 + tmp20
    tmp22 = libdevice.tanh(tmp21)
    tmp25 = tmp23 + tmp24
    tmp27 = tmp25 + tmp26
    tmp28 = tl.sigmoid(tmp27)
    tmp29 = tmp22 * tmp28
    tl.store(in_out_ptr0 + x2, tmp22, xmask)
    tl.store(out_ptr0 + x2, tmp29, xmask)


def call(args):
    (primals_1, primals_2, primals_3, primals_4, primals_5, primals_6,
        primals_7, primals_8, primals_9, primals_10, primals_11, primals_12,
        primals_13, primals_14, primals_15, primals_16, primals_17) = args
    args.clear()
    assert_size_stride(primals_1, (4, 1), (1, 1))
    assert_size_stride(primals_2, (4, 1), (1, 1))
    assert_size_stride(primals_3, (4, 4), (4, 1))
    assert_size_stride(primals_4, (4, 4), (4, 1))
    assert_size_stride(primals_5, (4, 4), (4, 1))
    assert_size_stride(primals_6, (4, 1), (1, 1))
    assert_size_stride(primals_7, (4, 4), (4, 1))
    assert_size_stride(primals_8, (4, 4), (4, 1))
    assert_size_stride(primals_9, (4, 1), (1, 1))
    assert_size_stride(primals_10, (4, 4), (4, 1))
    assert_size_stride(primals_11, (4, 4), (4, 1))
    assert_size_stride(primals_12, (4, 1), (1, 1))
    assert_size_stride(primals_13, (4, 4), (4, 1))
    assert_size_stride(primals_14, (4, 4), (4, 1))
    assert_size_stride(primals_15, (4, 1), (1, 1))
    assert_size_stride(primals_16, (4, 4), (4, 1))
    assert_size_stride(primals_17, (4, 1), (1, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.mm(primals_5, primals_1, out=buf0)
        buf1 = empty_strided_cuda((4,), (1,), torch.float32)
        buf11 = empty_strided_cuda((4,), (1,), torch.float32)
        buf21 = empty_strided_cuda((4,), (1,), torch.float32)
        buf31 = empty_strided_cuda((4,), (1,), torch.float32)
        buf3 = empty_strided_cuda((4,), (1,), torch.float32)
        buf13 = empty_strided_cuda((4,), (1,), torch.float32)
        buf23 = empty_strided_cuda((4,), (1,), torch.float32)
        buf33 = empty_strided_cuda((4,), (1,), torch.float32)
        buf5 = empty_strided_cuda((4,), (1,), torch.float32)
        buf15 = empty_strided_cuda((4,), (1,), torch.float32)
        buf25 = empty_strided_cuda((4,), (1,), torch.float32)
        buf35 = empty_strided_cuda((4,), (1,), torch.float32)
        buf7 = empty_strided_cuda((4,), (1,), torch.float32)
        buf17 = empty_strided_cuda((4,), (1,), torch.float32)
        buf27 = empty_strided_cuda((4,), (1,), torch.float32)
        buf37 = empty_strided_cuda((4,), (1,), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_mv_0[grid(4)](primals_3, primals_4, primals_7,
            primals_10, primals_13, buf1, buf11, buf21, buf31, buf3, buf13,
            buf23, buf33, buf5, buf15, buf25, buf35, buf7, buf17, buf27,
            buf37, 4, XBLOCK=4, num_warps=1, num_stages=1)
        buf2 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.mm(primals_8, primals_1, out=buf2)
        buf4 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.mm(primals_11, primals_1, out=buf4)
        buf6 = empty_strided_cuda((4, 1), (1, 1), torch.float32)
        extern_kernels.mm(primals_14, primals_1, out=buf6)
        buf8 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf9 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_mul_mv_sigmoid_tanh_1[grid(16)](buf1, buf0,
            primals_6, buf3, buf2, primals_9, primals_2, buf5, buf4,
            primals_12, buf7, buf6, primals_15, buf8, buf9, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        del buf1
        del buf3
        del buf5
        del buf7
        buf10 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_5, buf9, out=buf10)
        buf12 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_8, buf9, out=buf12)
        buf14 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_11, buf9, out=buf14)
        buf16 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_14, buf9, out=buf16)
        buf18 = buf8
        del buf8
        buf19 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_mul_mv_sigmoid_tanh_2[grid(16)](buf18, buf11,
            buf10, primals_6, buf13, buf12, primals_9, buf15, buf14,
            primals_12, buf17, buf16, primals_15, buf19, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        del buf11
        del buf13
        del buf15
        del buf17
        buf20 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_5, buf19, out=buf20)
        buf22 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_8, buf19, out=buf22)
        buf24 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_11, buf19, out=buf24)
        buf26 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_14, buf19, out=buf26)
        buf28 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf29 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_mul_mv_sigmoid_tanh_3[grid(16)](buf21, buf20,
            primals_6, buf23, buf22, primals_9, buf18, buf25, buf24,
            primals_12, buf27, buf26, primals_15, buf28, buf29, 16, XBLOCK=
            16, num_warps=1, num_stages=1)
        del buf21
        del buf23
        del buf25
        del buf27
        buf30 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_5, buf29, out=buf30)
        buf32 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_8, buf29, out=buf32)
        buf34 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_11, buf29, out=buf34)
        buf36 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_14, buf29, out=buf36)
        buf38 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf39 = buf38
        del buf38
        buf40 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_mul_mv_sigmoid_tanh_4[grid(16)](buf39, buf31,
            buf30, primals_6, buf33, buf32, primals_9, buf28, buf35, buf34,
            primals_12, buf37, buf36, primals_15, buf40, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        del buf31
        del buf33
        del buf35
        del buf37
        buf41 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.addmm(primals_17, primals_16, buf40, alpha=1, beta=1,
            out=buf41)
        del primals_17
    return (reinterpret_tensor(buf41, (4, 4), (1, 4), 0), primals_2,
        primals_3, primals_4, primals_6, primals_7, primals_9, primals_10,
        primals_12, primals_13, primals_15, buf0, buf2, buf4, buf6, buf10,
        buf12, buf14, buf16, buf18, buf20, buf22, buf24, buf26, buf28,
        buf30, buf32, buf34, buf36, buf39, reinterpret_tensor(primals_16, (
        4, 4), (1, 4), 0), reinterpret_tensor(buf40, (4, 4), (1, 4), 0),
        reinterpret_tensor(primals_14, (4, 4), (1, 4), 0),
        reinterpret_tensor(buf29, (4, 4), (1, 4), 0), reinterpret_tensor(
        primals_11, (4, 4), (1, 4), 0), reinterpret_tensor(primals_8, (4, 4
        ), (1, 4), 0), reinterpret_tensor(primals_5, (4, 4), (1, 4), 0),
        reinterpret_tensor(buf19, (4, 4), (1, 4), 0), reinterpret_tensor(
        buf9, (4, 4), (1, 4), 0), reinterpret_tensor(primals_1, (1, 4), (1,
        1), 0))


class LSTMNew(nn.Module):

    def __init__(self, seq_length, input_dim, num_hidden, num_classes,
        batch_size, device='cpu'):
        super(LSTMNew, self).__init__()
        self.seq_length = seq_length
        self.h_init = nn.Parameter(torch.zeros(num_hidden, 1),
            requires_grad=False)
        self.c_init = nn.Parameter(torch.zeros(num_hidden, 1),
            requires_grad=False)
        self.w_gx = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_gh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_g = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ix = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_ih = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_i = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_fx = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_fh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_f = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ox = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, input_dim).normal_(mean=0, std=0.0001)))
        self.w_oh = nn.Parameter(nn.init.orthogonal_(torch.Tensor(
            num_hidden, num_hidden).normal_(mean=0, std=0.0001)))
        self.b_o = nn.Parameter(torch.Tensor(num_hidden, 1).zero_())
        self.w_ph = nn.Parameter(torch.Tensor(num_classes, num_hidden).
            normal_(mean=0, std=0.0001))
        self.b_p = nn.Parameter(torch.Tensor(num_classes, 1).zero_())

    def forward(self, input_0):
        primals_1 = self.h_init
        primals_2 = self.c_init
        primals_3 = self.w_gx
        primals_4 = self.w_gh
        primals_6 = self.b_g
        primals_5 = self.w_ix
        primals_7 = self.w_ih
        primals_9 = self.b_i
        primals_8 = self.w_fx
        primals_10 = self.w_fh
        primals_12 = self.b_f
        primals_11 = self.w_ox
        primals_13 = self.w_oh
        primals_15 = self.b_o
        primals_14 = self.w_ph
        primals_17 = self.b_p
        primals_16 = input_0
        output = call([primals_1, primals_2, primals_3, primals_4,
            primals_5, primals_6, primals_7, primals_8, primals_9,
            primals_10, primals_11, primals_12, primals_13, primals_14,
            primals_15, primals_16, primals_17])
        return output[0]


Measured latency_ms: 0.110802