def global_max_pool2d_check(expr):
    """Check if the nn.global_max_pool2d can be executed in BNNS"""
    attrs, args = expr.attrs, expr.args
    data_typ = args[0].checked_type
    rank = len(data_typ.shape)
    if rank < 3 or rank > 4 or data_typ.dtype != "float32":
        return False
    if attrs.layout != "NCHW":
        return False
    return True