monai.deploy.core.Operator

class monai.deploy.core.Operator(self: holoscan.core._core.Operator, arg0: object, arg1: holoscan::Fragment, *args, **kwargs) None[source]

Bases: holoscan.core._core.Operator

Operator class.

Can be initialized with any number of Python positional and keyword arguments.

If a name keyword argument is provided, it must be a str and will be used to set the name of the operator.

Condition classes will be added to self.conditions, Resource classes will be added to self.resources, and any other arguments will be cast from a Python argument type to a C++ Arg and stored in self.args. (For details on how the casting is done, see the py_object_to_arg utility). When a Condition or Resource is provided via a kwarg, it’s name will be automatically be updated to the name of the kwarg.

fragmentholoscan.core.Fragment

The holoscan.core.Fragment (or holoscan.core.Application) to which this Operator will belong.

*args

Positional arguments.

**kwargs

Keyword arguments.

RuntimeError

If name kwarg is provided, but is not of str type. If multiple arguments of type Fragment are provided. If any other arguments cannot be converted to Arg type via py_object_to_arg.

Operator class.

Can be initialized with any number of Python positional and keyword arguments.

If a name keyword argument is provided, it must be a str and will be used to set the name of the operator.

Condition classes will be added to self.conditions, Resource classes will be added to self.resources, and any other arguments will be cast from a Python argument type to a C++ Arg and stored in self.args. (For details on how the casting is done, see the py_object_to_arg utility). When a Condition or Resource is provided via a kwarg, it’s name will be automatically be updated to the name of the kwarg.

fragmentholoscan.core.Fragment

The holoscan.core.Fragment (or holoscan.core.Application) to which this Operator will belong.

*args

Positional arguments.

**kwargs

Keyword arguments.

RuntimeError

If name kwarg is provided, but is not of str type. If multiple arguments of type Fragment are provided. If any other arguments cannot be converted to Arg type via py_object_to_arg.

Methods

__init__(self, arg0, arg1, *args, **kwargs)

__init__(self: holoscan.core._core.Operator, arg0: object, arg1: holoscan::Fragment, *args, **kwargs) -> None

add_arg(*args, **kwargs)

Overloaded function.

compute(op_input, op_output, context)

Default implementation of compute

initialize()

Default implementation of initialize

resource(self, name)

Resources associated with the operator.

setup(spec)

Default implementation of setup method.

start()

Default implementation of start

stop()

Default implementation of stop

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment (holoscan.core.Fragment) that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

The operator spec (holoscan.core.OperatorSpec) associated with the operator.

class OperatorType(self: holoscan.core._core.Operator.OperatorType, value: int) None

Bases: pybind11_builtins.pybind11_object

Enum class for operator types used by the executor.

  • NATIVE: Native operator.

  • GXF: GXF operator.

  • VIRTUAL: Virtual operator. (for internal use, not intended for use by application authors)

Members:

NATIVE

GXF

VIRTUAL

property name
__init__(self: holoscan.core._core.Operator, arg0: object, arg1: holoscan::Fragment, *args, **kwargs) None[source]

__init__(self: holoscan.core._core.Operator, arg0: object, arg1: holoscan::Fragment, *args, **kwargs) -> None

Operator class.

Can be initialized with any number of Python positional and keyword arguments.

If a name keyword argument is provided, it must be a str and will be used to set the name of the operator.

Condition classes will be added to self.conditions, Resource classes will be added to self.resources, and any other arguments will be cast from a Python argument type to a C++ Arg and stored in self.args. (For details on how the casting is done, see the py_object_to_arg utility). When a Condition or Resource is provided via a kwarg, it’s name will be automatically be updated to the name of the kwarg.

fragmentholoscan.core.Fragment

The holoscan.core.Fragment (or holoscan.core.Application) to which this Operator will belong.

*args

Positional arguments.

**kwargs

Keyword arguments.

RuntimeError

If name kwarg is provided, but is not of str type. If multiple arguments of type Fragment are provided. If any other arguments cannot be converted to Arg type via py_object_to_arg.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Operator, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Operator, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

  1. add_arg(self: holoscan.core._core.Operator, **kwargs) -> None

Add arguments to the component via Python kwargs.

  1. add_arg(self: holoscan.core._core.Operator, arg: holoscan.core._core.Condition) -> None

  2. add_arg(self: holoscan.core._core.Operator, arg: holoscan.core._core.Resource) -> None

Add a condition or resource to the Operator.

This can be used to add a condition or resource to an operator after it has already been constructed.

argholoscan.core.Condition or holoscan.core.Resource

The condition or resource to add.

property args

The list of arguments associated with the component.

arglist : holoscan.core.ArgList

compute(op_input, op_output, context)[source]

Default implementation of compute

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

property fragment

The fragment (holoscan.core.Fragment) that the operator belongs to.

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

id : int

initialize()[source]

Default implementation of initialize

property name

The name of the operator.

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

resource(self: holoscan.core._core.Operator, name: str) Optional[object]

Resources associated with the operator.

name : str The name of the resource to retrieve

holoscan.core.Resource or None

The resource with the given name. If no resource with the given name is found, None is returned.

property resources

Resources associated with the operator.

setup(spec)[source]

Default implementation of setup method.

property spec

The operator spec (holoscan.core.OperatorSpec) associated with the operator.

start()[source]

Default implementation of start

stop()[source]

Default implementation of stop