def METHOD_NAME(m):
    if len(list(m.children())) > 0:
        return
    m.register_buffer('total_ops', paddle.zeros([1], dtype='int64'))
    m.register_buffer('total_params', paddle.zeros([1], dtype='int64'))
    m_type = type(m)
    flops_fn = None
    if m_type in custom_ops:
        flops_fn = custom_ops[m_type]
        if m_type not in types_collection:
            print("Customize Function has been applied to {}.".format(
                m_type))
    elif m_type in register_hooks:
        flops_fn = register_hooks[m_type]
        if m_type not in types_collection:
            print("{}'s FLOPs has been counted.".format(m_type))
    else:
        if m_type not in types_collection:
            print(
                "Cannot find suitable count function for {}. Treat it as zero FLOPs."
                .format(m_type))
    if flops_fn is not None:
        flops_handler = m.register_forward_post_hook(flops_fn)
        handler_collection.append(flops_handler)
    params_handler = m.register_forward_post_hook(count_parameters)
    io_handler = m.register_forward_post_hook(count_io_info)
    handler_collection.append(params_handler)
    handler_collection.append(io_handler)
    types_collection.add(m_type)