def METHOD_NAME(data, rois, pooled_size, spatial_scale, mode, sample_ratio=-1):
    """ROI align operator in NHWC layout.
    Parameters
    ----------
    data : tvm.te.Tensor
        4-D with shape [batch, height, width, channel]
    rois : tvm.te.Tensor
        2-D with shape [num_roi, 5]. The last dimension should be in format of
        [batch_index, w_start, h_start, w_end, h_end]
    pooled_size : int or list/tuple of two ints
        output size, or [out_height, out_width]
    spatial_scale : float
        Ratio of input feature map height (or w) to raw image height (or w). Equals the reciprocal
        of total stride in convolutional layers, which should be in range (0.0, 1.0]
    mode : int or str
        There are two modes, average and max. For the average mode, you can pass b'avg' or 0, and
        for the max mode, you can pass b'max' or 1.
    sample_ratio : int
        Optional sampling ratio of ROI align, using adaptive size by default.
    Returns
    -------
    output : tvm.te.Tensor
        4-D with shape [num_roi, pooled_size, pooled_size, channel]
    """
    avg_mode = mode in (b"avg", 0)
    max_mode = mode in (b"max", 1)
    assert avg_mode or max_mode, "Mode must be avg or max. Please pass in a valid mode."
    dtype = rois.dtype
    _, height, width, channel = get_const_tuple(data.shape)
    num_roi, _ = get_const_tuple(rois.shape)
    if isinstance(pooled_size, int):
        pooled_size_h = pooled_size_w = pooled_size
    else:
        pooled_size_h, pooled_size_w = pooled_size
    def _bilinear(i, c, y, x):
        outside = tvm.tir.any(y < -1.0, x < -1.0, y > height, x > width)
        y = tvm.te.min(tvm.te.max(y, 0.0), height - 1)
        x = tvm.te.min(tvm.te.max(x, 0.0), width - 1)
        val = bilinear_sample_nhwc(data, (i, y, x, c), height - 1, width - 1)
        return tvm.tir.if_then_else(outside, 0.0, val)
    def _sample(i, ph, pw, c):
        return _sample_common(
            i,
            c,
            ph,
            pw,
            rois,
            pooled_size_h,
            pooled_size_w,
            spatial_scale,
            sample_ratio,
            dtype,
            avg_mode,
            _bilinear,
        )
    return te.compute(
        (num_roi, pooled_size_h, pooled_size_w, channel), _sample, tag="pool,roi_align_nchw"
    )