(module)
return list(module.children()) == []
Checks if given module is a leaf module.

    :param module: PyTorch module
    :type module: `torch.nn.Module`
    :return: Boolean value representing whether module is a leaf.
    :rtype: `bool`
Checks if given module is a leaf module.
Checks if given module is a leaf module .
def is_leaf_node(module):
    """
    Checks if given module is a leaf module.

    :param module: PyTorch module
    :type module: `torch.nn.Module`
    :return: Boolean value representing whether module is a leaf.
    :rtype: `bool`
    """
    return list(module.children()) == []
def is_leaf_node ( module ) : return list ( module . children ( ) ) == [ ]