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_cat_0(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 192
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 48
    x2 = xindex
    x0 = xindex % 48
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = x2 % 12
    tmp7 = tl.full([1], 4, tl.int64)
    tmp8 = tmp5 < tmp7
    tmp9 = tmp8 & tmp4
    tmp10 = tl.load(in_ptr0 + (4 * (x0 // 12) + x0 % 12), tmp9 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp11 = tmp5 >= tmp7
    tmp12 = tl.full([1], 8, tl.int64)
    tmp13 = tmp5 < tmp12
    tmp14 = tmp11 & tmp13
    tmp15 = tmp14 & tmp4
    tmp16 = tl.load(in_ptr0 + (4 * (x0 // 12) + (-4 + x0 % 12)), tmp15 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp17 = tl.load(in_ptr0 + (16 + 4 * (x0 // 12) + (-4 + x0 % 12)), tmp15 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp18 = tmp16 + tmp17
    tmp19 = tl.load(in_ptr0 + (32 + 4 * (x0 // 12) + (-4 + x0 % 12)), tmp15 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp20 = tmp18 + tmp19
    tmp21 = tl.load(in_ptr0 + (48 + 4 * (x0 // 12) + (-4 + x0 % 12)), tmp15 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp22 = tmp20 + tmp21
    tmp23 = 4.0
    tmp24 = tmp22 / tmp23
    tmp25 = tl.full(tmp24.shape, 0.0, tmp24.dtype)
    tmp26 = tl.where(tmp15, tmp24, tmp25)
    tmp27 = tmp5 >= tmp12
    tl.full([1], 12, tl.int64)
    tmp30 = tmp27 & tmp4
    tmp31 = tl.load(in_ptr0 + (48 + 4 * (x0 // 12) + (-8 + x0 % 12)), tmp30 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp32 = tl.where(tmp14, tmp26, tmp31)
    tmp33 = tl.where(tmp8, tmp10, tmp32)
    tmp34 = tl.full(tmp33.shape, 0.0, tmp33.dtype)
    tmp35 = tl.where(tmp4, tmp33, tmp34)
    tmp36 = tmp0 >= tmp3
    tmp37 = tl.full([1], 2, tl.int64)
    tmp38 = tmp0 < tmp37
    tmp39 = tmp36 & tmp38
    tmp40 = tmp8 & tmp39
    tmp41 = tl.load(in_ptr0 + (64 + 4 * (x0 // 12) + x0 % 12), tmp40 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp42 = tmp14 & tmp39
    tmp43 = tl.load(in_ptr0 + (64 + 4 * (x0 // 12) + (-4 + x0 % 12)), tmp42 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp44 = tl.load(in_ptr0 + (80 + 4 * (x0 // 12) + (-4 + x0 % 12)), tmp42 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp45 = tmp43 + tmp44
    tmp46 = tl.load(in_ptr0 + (96 + 4 * (x0 // 12) + (-4 + x0 % 12)), tmp42 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp47 = tmp45 + tmp46
    tmp48 = tl.load(in_ptr0 + (112 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp42 & xmask, eviction_policy='evict_last', other=0.0)
    tmp49 = tmp47 + tmp48
    tmp50 = tmp49 / tmp23
    tmp51 = tl.full(tmp50.shape, 0.0, tmp50.dtype)
    tmp52 = tl.where(tmp42, tmp50, tmp51)
    tmp53 = tmp27 & tmp39
    tmp54 = tl.load(in_ptr0 + (112 + 4 * (x0 // 12) + (-8 + x0 % 12)), 
        tmp53 & xmask, eviction_policy='evict_last', other=0.0)
    tmp55 = tl.where(tmp14, tmp52, tmp54)
    tmp56 = tl.where(tmp8, tmp41, tmp55)
    tmp57 = tl.full(tmp56.shape, 0.0, tmp56.dtype)
    tmp58 = tl.where(tmp39, tmp56, tmp57)
    tmp59 = tmp0 >= tmp37
    tmp60 = tl.full([1], 3, tl.int64)
    tmp61 = tmp0 < tmp60
    tmp62 = tmp59 & tmp61
    tmp63 = tmp8 & tmp62
    tmp64 = tl.load(in_ptr0 + (128 + 4 * (x0 // 12) + x0 % 12), tmp63 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp65 = tmp14 & tmp62
    tmp66 = tl.load(in_ptr0 + (128 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp65 & xmask, eviction_policy='evict_last', other=0.0)
    tmp67 = tl.load(in_ptr0 + (144 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp65 & xmask, eviction_policy='evict_last', other=0.0)
    tmp68 = tmp66 + tmp67
    tmp69 = tl.load(in_ptr0 + (160 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp65 & xmask, eviction_policy='evict_last', other=0.0)
    tmp70 = tmp68 + tmp69
    tmp71 = tl.load(in_ptr0 + (176 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp65 & xmask, eviction_policy='evict_last', other=0.0)
    tmp72 = tmp70 + tmp71
    tmp73 = tmp72 / tmp23
    tmp74 = tl.full(tmp73.shape, 0.0, tmp73.dtype)
    tmp75 = tl.where(tmp65, tmp73, tmp74)
    tmp76 = tmp27 & tmp62
    tmp77 = tl.load(in_ptr0 + (176 + 4 * (x0 // 12) + (-8 + x0 % 12)), 
        tmp76 & xmask, eviction_policy='evict_last', other=0.0)
    tmp78 = tl.where(tmp14, tmp75, tmp77)
    tmp79 = tl.where(tmp8, tmp64, tmp78)
    tmp80 = tl.full(tmp79.shape, 0.0, tmp79.dtype)
    tmp81 = tl.where(tmp62, tmp79, tmp80)
    tmp82 = tmp0 >= tmp60
    tmp84 = tmp8 & tmp82
    tmp85 = tl.load(in_ptr0 + (192 + 4 * (x0 // 12) + x0 % 12), tmp84 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp86 = tmp14 & tmp82
    tmp87 = tl.load(in_ptr0 + (192 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp86 & xmask, eviction_policy='evict_last', other=0.0)
    tmp88 = tl.load(in_ptr0 + (208 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp86 & xmask, eviction_policy='evict_last', other=0.0)
    tmp89 = tmp87 + tmp88
    tmp90 = tl.load(in_ptr0 + (224 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp86 & xmask, eviction_policy='evict_last', other=0.0)
    tmp91 = tmp89 + tmp90
    tmp92 = tl.load(in_ptr0 + (240 + 4 * (x0 // 12) + (-4 + x0 % 12)), 
        tmp86 & xmask, eviction_policy='evict_last', other=0.0)
    tmp93 = tmp91 + tmp92
    tmp94 = tmp93 / tmp23
    tmp95 = tl.full(tmp94.shape, 0.0, tmp94.dtype)
    tmp96 = tl.where(tmp86, tmp94, tmp95)
    tmp97 = tmp27 & tmp82
    tmp98 = tl.load(in_ptr0 + (240 + 4 * (x0 // 12) + (-8 + x0 % 12)), 
        tmp97 & xmask, eviction_policy='evict_last', other=0.0)
    tmp99 = tl.where(tmp14, tmp96, tmp98)
    tmp100 = tl.where(tmp8, tmp85, tmp99)
    tmp101 = tl.full(tmp100.shape, 0.0, tmp100.dtype)
    tmp102 = tl.where(tmp82, tmp100, tmp101)
    tmp103 = tl.where(tmp62, tmp81, tmp102)
    tmp104 = tl.where(tmp39, tmp58, tmp103)
    tmp105 = tl.where(tmp4, tmp35, tmp104)
    tl.store(out_ptr0 + x2, tmp105, xmask)


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


class CatReprNew(nn.Module):

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

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


Measured latency_ms: 0.013796