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 import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch.nn import Module
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
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_elu_exp_mul_relu_0(in_out_ptr0, in_ptr0, out_ptr0,
    out_ptr1, out_ptr2, out_ptr3, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp8 = tl.load(in_out_ptr0 + x0, xmask)
    tmp1 = 0.0
    tmp2 = tmp0 > tmp1
    tmp3 = 1.0
    tmp4 = tmp0 * tmp3
    tmp5 = libdevice.expm1(tmp4)
    tmp6 = tmp5 * tmp3
    tmp7 = tl.where(tmp2, tmp4, tmp6)
    tmp9 = tl.full([1], 0, tl.int32)
    tmp10 = triton_helpers.maximum(tmp9, tmp8)
    tmp11 = -1.0
    tmp12 = tmp10 * tmp11
    tmp13 = tl_math.exp(tmp12)
    tmp14 = tmp7 * tmp13
    tmp15 = tmp10 * tmp13
    tmp16 = tmp15 * tmp13
    tl.store(out_ptr0 + x0, tmp7, xmask)
    tl.store(in_out_ptr0 + x0, tmp10, xmask)
    tl.store(out_ptr1 + x0, tmp14, xmask)
    tl.store(out_ptr2 + x0, tmp15, xmask)
    tl.store(out_ptr3 + x0, tmp16, xmask)


def call(args):
    primals_1, primals_2, primals_3, primals_4, primals_5 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4), (4, 1))
    assert_size_stride(primals_2, (4, 4), (4, 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))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_1, primals_2, out=buf0)
        del primals_2
        buf2 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_1, primals_3, out=buf2)
        del primals_3
        buf1 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf3 = buf2
        del buf2
        buf4 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf6 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf7 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_elu_exp_mul_relu_0[grid(16)](buf3, buf0, buf1,
            buf4, buf6, buf7, 16, XBLOCK=16, num_warps=1, num_stages=1)
        buf5 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_4, buf4, out=buf5)
        buf8 = buf4
        del buf4
        extern_kernels.mm(primals_5, buf7, out=buf8)
        del buf7
    return buf5, buf8, buf3, buf1, buf0, buf1, buf3, buf6, reinterpret_tensor(
        primals_5, (4, 4), (1, 4), 0), reinterpret_tensor(primals_4, (4, 4),
        (1, 4), 0), reinterpret_tensor(primals_1, (4, 4), (1, 4), 0)


class GGCL_FNew(Module):
    """Graph Gaussian Convolution Layer (GGCL) when the input is feature"""

    def __init__(self, in_features, out_features, dropout=0.6):
        super(GGCL_FNew, self).__init__()
        self.in_features = in_features
        self.out_features = out_features
        self.dropout = dropout
        self.weight_miu = Parameter(torch.FloatTensor(in_features,
            out_features))
        self.weight_sigma = Parameter(torch.FloatTensor(in_features,
            out_features))
        self.reset_parameters()

    def reset_parameters(self):
        torch.nn.init.xavier_uniform_(self.weight_miu)
        torch.nn.init.xavier_uniform_(self.weight_sigma)

    def forward(self, input_0, input_1, input_2):
        primals_1 = self.weight_miu
        primals_2 = self.weight_sigma
        primals_3 = input_0
        primals_4 = input_1
        primals_5 = input_2
        output = call([primals_1, primals_2, primals_3, primals_4, primals_5])
        return output[0], output[1]


Measured latency_ms: 0.043954