MCPcopy Index your code
hub / github.com/GPflow/GPflow / create

Method create

benchmark/metadata.py:61–97  ·  view source on GitHub ↗

Collects information about the current environment and creates a new `BenchmarkMetadata` with it.

(suite_name: str)

Source from the content-addressed store, hash-verified

59
60 @staticmethod
61 def create(suite_name: str) -> "BenchmarkMetadata":
62 """
63 Collects information about the current environment and creates a new `BenchmarkMetadata`
64 with it.
65 """
66 suite_name = suite_name
67 argv = sys.argv
68 script_name = Path(argv[0]).stem
69 user = getpass.getuser()
70 hostname = gethostname()
71 timestamp = _get_timestamp()
72 py_ver = python_version()
73 tf_ver = tf.__version__
74 np_ver = np.__version__
75 ram = psutil.virtual_memory().total
76 cpu_name, cpu_count, cpu_frequency = _get_cpu_name_count_frequency()
77 gpu_names = _get_gpu_names()
78 git_branch_name, git_commit = _get_git_branch_and_commit()
79 run_id = f"{script_name}_{suite_name}_{git_branch_name}_{timestamp}".replace("/", "_")
80 return BenchmarkMetadata(
81 suite_name=suite_name,
82 argv=argv,
83 user=user,
84 hostname=hostname,
85 timestamp=timestamp,
86 py_ver=py_ver,
87 tf_ver=tf_ver,
88 np_ver=np_ver,
89 ram=ram,
90 cpu_name=cpu_name,
91 cpu_count=cpu_count,
92 cpu_frequency=cpu_frequency,
93 gpu_names=gpu_names,
94 git_branch_name=git_branch_name,
95 git_commit=git_commit,
96 run_id=run_id,
97 )
98
99 def for_shard(self) -> "BenchmarkMetadata":
100 """

Callers 4

runFunction · 0.80
plot_from_argvFunction · 0.80
for_shardMethod · 0.80
test_metadata_smokeFunction · 0.80

Calls 5

_get_timestampFunction · 0.85
_get_gpu_namesFunction · 0.85
BenchmarkMetadataClass · 0.85

Tested by 1

test_metadata_smokeFunction · 0.64