def dump_compiler_info()

in src/neuron-gatherinfo/neuron-gatherinfo.py [0:0]


def dump_compiler_info(*, outdir, location, allowmodel=False, addfldir=None, verbose=False):
    ''' function to gather the following information:
            Framework:
                - TensorFlow
                - MXNet
                - PyTorch
            Compiler:
        Args:
            outdir      : output directory
            location    : location of compiler-generated files
            allowmodel  : if True, allow gathering of additional files
            verbose : flag to indicate if verbose messages need to be displayed

        Output: compiler-generated files copied to outdir

        Returns:
    '''

    if location is not None:
        if allowmodel:  # copy the entire directory
            try:
                shutil.copytree(location, os.path.join(outdir, os.path.basename(location)),
                                ignore_dangling_symlinks=True)
            except shutil.Error:
                pass
        else:
            fileset = set(COMPILER_FILES)
            l1data = get_files(basedir=location, matchfiles=fileset, verbose=verbose)
            copy_files(outdir=outdir, basedir=location, filelist=l1data, verbose=verbose)

        if addfldir is not None:
            if os.path.isfile(addfldir):
                shutil.copy(addfldir, outdir)
            else:  # directory copy
                try:
                    shutil.copytree(addfldir, os.path.join(outdir, os.path.basename(addfldir)),
                                    ignore_dangling_symlinks=True)
                except shutil.Error:
                    pass