def METHOD_NAME(attrs, inputs, _):
    """Shape function for upsampling. Supports NCHW and NHWC layouts."""
    layout = attrs.layout
    height_axis = width_axis = 1
    for i, letter in enumerate(layout):
        if letter == "H":
            height_axis = i
        if letter == "W":
            width_axis = i
    return [
        _upsampling_shape_func(
            inputs[0].shape, inputs[1], inputs[2], convert(height_axis), convert(width_axis)
        )
    ]