def get_classes_in_module(module):
    """
    Get all classes defined in a module (excluding imported ones)
    """
    return {
        name: obj
        for name, obj in inspect.getmembers(module, inspect.isclass)
        if obj.__module__.startswith(module.__name__)
    }

    Get all classes defined in a module (excluding imported ones)
    
coremltools/test/optimize/torch/utils.py