mirror of
https://github.com/clearml/clearml
synced 2025-01-31 17:17:00 +00:00
20 lines
408 B
Python
20 lines
408 B
Python
# ClearML - Example of Python Fire integration, with commands derived from an object
|
|
#
|
|
from clearml import Task
|
|
|
|
import fire
|
|
|
|
|
|
class Calculator(object):
|
|
def add(self, x, y):
|
|
return x + y
|
|
|
|
def multiply(self, x, y):
|
|
return x * y
|
|
|
|
|
|
if __name__ == "__main__":
|
|
Task.init(project_name="examples", task_name="Fire object command")
|
|
calculator = Calculator()
|
|
fire.Fire(calculator)
|