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
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
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, in_ptr1, in_ptr2, in_ptr3, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 4096 % 64
    x0 = xindex % 4096
    x2 = xindex // 262144
    x3 = xindex
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 16, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + 4096 * x1 + 65536 * x2), tmp4, other=0.0)
    tmp6 = tmp0 >= tmp3
    tmp7 = tl.full([1], 32, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tmp6 & tmp8
    tmp10 = tl.load(in_ptr1 + (x0 + 4096 * (-16 + x1) + 65536 * x2), tmp9,
        other=0.0)
    tmp11 = tmp0 >= tmp7
    tmp12 = tl.full([1], 48, tl.int64)
    tmp13 = tmp0 < tmp12
    tmp14 = tmp11 & tmp13
    tmp15 = tl.load(in_ptr2 + (x0 + 4096 * (-32 + x1) + 65536 * x2), tmp14,
        other=0.0)
    tmp16 = tmp0 >= tmp12
    tl.full([1], 64, tl.int64)
    tmp19 = tl.load(in_ptr3 + (x0 + 4096 * (-48 + x1) + 65536 * x2), tmp16,
        other=0.0)
    tmp20 = tl.where(tmp14, tmp15, tmp19)
    tmp21 = tl.where(tmp9, tmp10, tmp20)
    tmp22 = tl.where(tmp4, tmp5, tmp21)
    tl.store(out_ptr0 + x3, tmp22, None)


def call(args):
    primals_1, primals_2, primals_3, primals_4, primals_5 = args
    args.clear()
    assert_size_stride(primals_1, (16, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_2, (4, 64, 64, 64), (262144, 4096, 64, 1))
    assert_size_stride(primals_3, (16, 16, 5, 5), (400, 25, 5, 1))
    assert_size_stride(primals_4, (16, 8, 7, 7), (392, 49, 7, 1))
    assert_size_stride(primals_5, (16, 4, 9, 9), (324, 81, 9, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_2, primals_1, stride=(1, 
            1), padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf1 = extern_kernels.convolution(primals_2, primals_3, stride=(1, 
            1), padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=4, bias=None)
        assert_size_stride(buf1, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf2 = extern_kernels.convolution(primals_2, primals_4, stride=(1, 
            1), padding=(3, 3), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=8, bias=None)
        assert_size_stride(buf2, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf3 = extern_kernels.convolution(primals_2, primals_5, stride=(1, 
            1), padding=(4, 4), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=16, bias=None)
        assert_size_stride(buf3, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf4 = empty_strided_cuda((4, 64, 64, 64), (262144, 4096, 64, 1),
            torch.float32)
        get_raw_stream(0)
        triton_poi_fused_cat_0[grid(1048576)](buf0, buf1, buf2, buf3, buf4,
            1048576, XBLOCK=1024, num_warps=4, num_stages=1)
        del buf0
        del buf1
        del buf2
        del buf3
    return buf4, primals_1, primals_2, primals_3, primals_4, primals_5


def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1,
    dilation=1, groups=1):
    """standard convolution with padding"""
    return nn.Conv2d(in_planes, out_planes, kernel_size=kernel_size, stride
        =stride, padding=padding, dilation=dilation, groups=groups, bias=False)


class PyConv4New(nn.Module):

    def __init__(self, inplans, planes, pyconv_kernels=[3, 5, 7, 9], stride
        =1, pyconv_groups=[1, 4, 8, 16]):
        super(PyConv4New, self).__init__()
        self.conv2_1 = conv(inplans, planes // 4, kernel_size=
            pyconv_kernels[0], padding=pyconv_kernels[0] // 2, stride=
            stride, groups=pyconv_groups[0])
        self.conv2_2 = conv(inplans, planes // 4, kernel_size=
            pyconv_kernels[1], padding=pyconv_kernels[1] // 2, stride=
            stride, groups=pyconv_groups[1])
        self.conv2_3 = conv(inplans, planes // 4, kernel_size=
            pyconv_kernels[2], padding=pyconv_kernels[2] // 2, stride=
            stride, groups=pyconv_groups[2])
        self.conv2_4 = conv(inplans, planes // 4, kernel_size=
            pyconv_kernels[3], padding=pyconv_kernels[3] // 2, stride=
            stride, groups=pyconv_groups[3])

    def forward(self, input_0):
        primals_1 = self.conv2_1.weight
        primals_3 = self.conv2_2.weight
        primals_4 = self.conv2_3.weight
        primals_5 = self.conv2_4.weight
        primals_2 = input_0
        output = call([primals_1, primals_2, primals_3, primals_4, primals_5])
        return output[0]


Measured latency_ms: 0.174346