mirror of
https://github.com/clearml/clearml
synced 2025-05-02 03:55:23 +00:00
Support parameter auto casting int/float
This commit is contained in:
parent
e0d8c2fa91
commit
ac9aba9242
@ -268,6 +268,7 @@ class _Arguments(object):
|
|||||||
v_type = type(v)
|
v_type = type(v)
|
||||||
# assume more general purpose type int -> float
|
# assume more general purpose type int -> float
|
||||||
if v_type == int:
|
if v_type == int:
|
||||||
|
if int(v) != float(v):
|
||||||
v_type = float
|
v_type = float
|
||||||
elif v_type == bool:
|
elif v_type == bool:
|
||||||
# cast based on string or int
|
# cast based on string or int
|
||||||
|
@ -70,7 +70,8 @@ class PatchAbsl(object):
|
|||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
if running_remotely():
|
if running_remotely():
|
||||||
param_dict = cls._task._arguments.copy_to_dict({}, prefix=_Arguments._prefix_tf_defines)
|
param_dict = dict((k, FLAGS[k].value) for k in FLAGS)
|
||||||
|
param_dict = cls._task._arguments.copy_to_dict(param_dict, prefix=_Arguments._prefix_tf_defines)
|
||||||
for k, v in param_dict.items():
|
for k, v in param_dict.items():
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user