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_index_put_lift_fresh_0(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 100
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.9
    tmp2 = tmp0 >= tmp1
    tmp3 = 2.0
    tmp4 = tl.where(tmp2, tmp3, tmp0)
    tl.store(out_ptr0 + x0, tmp4, xmask)


@triton.jit
def triton_poi_fused_index_put_lift_fresh_1(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 100
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.9
    tmp2 = tmp0 < tmp1
    tmp3 = 1.0
    tmp4 = tl.where(tmp2, tmp3, tmp0)
    tl.store(out_ptr0 + x0, tmp4, xmask)


@triton.jit
def triton_per_fused_div_index_put_lift_fresh_mul_sum_2(in_ptr0, in_ptr1,
    out_ptr0, out_ptr2, xnumel, rnumel, XBLOCK: tl.constexpr):
    rnumel = 100
    RBLOCK: tl.constexpr = 128
    xoffset = tl.program_id(0) * XBLOCK
    xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    rmask = rindex < rnumel
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + r0, rmask, other=0.0)
    tmp9 = tl.load(in_ptr1 + r0, rmask, other=0.0)
    tmp1 = 2.0
    tmp2 = tmp0 == tmp1
    tmp3 = 0.0
    tmp4 = tl.where(tmp2, tmp3, tmp0)
    tmp5 = tl.broadcast_to(tmp4, [XBLOCK, RBLOCK])
    tmp7 = tl.where(rmask, tmp5, 0)
    tmp8 = tl.sum(tmp7, 1)[:, None]
    tmp10 = tmp9 * tmp4
    tmp11 = 100.0
    tmp12 = tmp10 * tmp11
    tmp13 = tmp12 / tmp8
    tl.store(out_ptr0 + tl.broadcast_to(r0, [XBLOCK, RBLOCK]), tmp4, rmask)
    tl.store(out_ptr2 + tl.broadcast_to(r0, [XBLOCK, RBLOCK]), tmp13, rmask)


def call(args):
    arg0_1, arg1_1 = args
    args.clear()
    assert_size_stride(arg0_1, (4, 1, 1, 25), (25, 25, 25, 1))
    assert_size_stride(arg1_1, (4, 1, 1, 25), (25, 25, 25, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        get_raw_stream(0)
        triton_poi_fused_index_put_lift_fresh_0[grid(100)](arg1_1, arg1_1, 
            100, XBLOCK=128, num_warps=4, num_stages=1)
        triton_poi_fused_index_put_lift_fresh_1[grid(100)](arg1_1, arg1_1, 
            100, XBLOCK=128, num_warps=4, num_stages=1)
        buf7 = empty_strided_cuda((4, 1, 1, 25), (25, 25, 25, 1), torch.float32
            )
        triton_per_fused_div_index_put_lift_fresh_mul_sum_2[grid(1)](arg1_1,
            arg0_1, arg1_1, buf7, 1, 100, XBLOCK=1, num_warps=2, num_stages=1)
        del arg0_1
        del arg1_1
    return buf7,


class DropBlock_SkeNew(nn.Module):

    def __init__(self, num_point=25, keep_prob=0.9):
        super(DropBlock_SkeNew, self).__init__()
        self.keep_prob = keep_prob
        self.num_point = num_point

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


Measured latency_ms: 0.0378