MCPcopy
hub / github.com/tensorflow/models / from_args

Method from_args

official/modeling/hyperparams/base_config.py:350–358  ·  view source on GitHub ↗

Builds a config from the given list of arguments.

(cls, *args, **kwargs)

Source from the content-addressed store, hash-verified

348
349 @classmethod
350 def from_args(cls, *args, **kwargs):
351 """Builds a config from the given list of arguments."""
352 # Note we intend to keep `__annotations__` instead of `_get_annotations`.
353 # Assuming a parent class of (a, b) with the sub-class of (c, d), the
354 # sub-class will take (c, d) for args, rather than starting from (a, b).
355 attributes = list(cls.__annotations__.keys())
356 default_params = {a: p for a, p in zip(attributes, args)}
357 default_params.update(kwargs)
358 return cls(default_params=default_params)

Callers 15

from_paramsMethod · 0.80
ModelConfigClass · 0.80
mnv2_deeplabv3_pascalFunction · 0.80
retinanet_mobile_cocoFunction · 0.80
bert_squadFunction · 0.80
mosaic_mnv35_cityscapesFunction · 0.80
get_test_paramsFunction · 0.80

Calls 1

updateMethod · 0.80

Tested by 3

test_bottleneck_blockMethod · 0.64
test_variablesMethod · 0.64