mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Add support for connecting Enum values as parameters
This commit is contained in:
@@ -6,10 +6,22 @@ from __future__ import print_function
|
||||
|
||||
import sys
|
||||
from argparse import ArgumentParser
|
||||
from enum import Enum
|
||||
|
||||
|
||||
from clearml import Task
|
||||
|
||||
|
||||
class StringEnumClass(Enum):
|
||||
A = 'a'
|
||||
B = 'b'
|
||||
|
||||
|
||||
class IntEnumClass(Enum):
|
||||
C = 1
|
||||
D = 2
|
||||
|
||||
|
||||
# Connecting ClearML with the current process,
|
||||
# from here on everything is logged automatically
|
||||
task = Task.init(project_name='examples', task_name='Hyper-parameters example')
|
||||
@@ -21,6 +33,8 @@ parameters = {
|
||||
'int': 3,
|
||||
'float': 2.2,
|
||||
'string': 'my string',
|
||||
'IntEnumParam': StringEnumClass.A,
|
||||
'StringEnumParam': IntEnumClass.C
|
||||
}
|
||||
parameters = task.connect(parameters)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user