@classmethod
def from_file(cls, net_file, file_type=None):
    """Loads a network from an ONNX or ERAN file format.

        Files ending in .onnx will be loaded as ONNX files, ones ending in
        .eran will be loaded as ERAN files. Pass file_tye="{eran, onnx}" to
        override this behavior.
        """
    if file_type is None:
        file_type = net_file.split('.')[-1]
    file_type = file_type.lower()
    if file_type == 'eran':
        return cls.from_eran(net_file)
    if file_type == 'onnx':
        return cls.from_onnx(net_file)
    raise NotImplementedError
