NVIDIA Holoscan SDK v2.9.0

holoscan.gxf

此模块为 C++ API 中的 GXF 基类提供 Python API。

holoscan.gxf.Entity holoscan.gxf._gxf.PyEntity 的别名
holoscan.gxf.GXFComponent 基于 GXF 的组件基类。
holoscan.gxf.GXFCondition 基于 GXF 的条件基类。
holoscan.gxf.GXFExecutionContext GXF 执行上下文。
holoscan.gxf.GXFInputContext GXF 输入上下文。
holoscan.gxf.GXFNetworkContext 基于 GXF 的网络上下文基类。
holoscan.gxf.GXFOperator 基于 GXF 的算子基类。
holoscan.gxf.GXFOutputContext GXF 输出上下文。
holoscan.gxf.GXFResource 基于 GXF 的资源基类。
holoscan.gxf.GXFScheduler 基于 GXF 的调度器基类。
holoscan.gxf.GXFSystemResourceBase 被视为 GXF nvidia::gxf::Resource 的类。

holoscan.gxf.Entity

holoscan.gxf._gxf.PyEntity 的别名

class holoscan.gxf.GXFComponent

基类:pybind11_builtins.pybind11_object

基于 GXF 的组件基类。

属性

gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。

方法

gxf_initialize(self) 初始化组件。

__init__(self: holoscan.gxf._gxf.GXFComponent) → None

基于 GXF 的组件基类。

property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回值
str

组件的 GXF 类型名称。

class holoscan.gxf.GXFCondition

基类:holoscan.core._core.Conditionholoscan.gxf._gxf.GXFComponent

基于 GXF 的条件基类。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
receiver(self, port_name) 获取与此条件关联的算子的输入端口使用的接收器。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的算子的输出端口使用的发射器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.gxf._gxf.GXFCondition) → None

基于 GXF 的条件基类。

add_arg(*args, **kwargs)

重载函数。

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

向组件添加参数。

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

向组件添加参数列表。

property args

与组件关联的参数列表。

返回值
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回值
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回值
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor) 时,标识符设置为 GXF 组件 ID。

返回值
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property name

条件的名称。

返回值
namestr
receiver(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Receiver]

获取与此条件关联的算子的输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回值
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的算子的输出端口使用的发射器。

参数
port_namestr

输出端口的名称。

返回值
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发射器。如果端口不存在,则为 None。

class holoscan.gxf.GXFExecutionContext

基类:holoscan.core._core.ExecutionContext

GXF 执行上下文。

__init__(self: holoscan.gxf._gxf.GXFExecutionContext, context: capsule, op: holoscan.gxf._gxf.GXFOperator) → None

使用 GXF 的算子的执行上下文。

参数
opholoscan.gxf.GXFOperator

拥有此上下文的 GXF 算子。

class holoscan.gxf.GXFInputContext

基类:holoscan.core._core.InputContext

GXF 输入上下文。

方法

receive(self, name)

__init__(self: holoscan.gxf._gxf.GXFInputContext, context: holoscan.core._core.ExecutionContext, op: holoscan.gxf._gxf.GXFOperator) → None

GXF 输入上下文。

参数
opholoscan.gxf.GXFOperator

拥有此上下文的 GXF 算子。

receive(self: holoscan.core._core.InputContext, name: str) → None
class holoscan.gxf.GXFNetworkContext

基类:holoscan.core._core.NetworkContextholoscan.gxf._gxf.GXFComponent

基于 GXF 的网络上下文基类。

属性

args 与组件关联的参数列表。
description 描述组件的 YAML 格式字符串。
fragment 网络上下文所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 网络上下文的名称。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 网络上下文的初始化方法。
setup(self, arg0) 网络上下文的设置方法。

__init__(*args, **kwargs)
add_arg(*args, **kwargs)

重载函数。

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

向组件添加参数。

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

向组件添加参数列表。

property args

与组件关联的参数列表。

返回值
arglistholoscan.core.ArgList
property description

描述组件的 YAML 格式字符串。

property fragment

网络上下文所属的 Fragment。

返回值
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回值
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor) 时,标识符设置为 GXF 组件 ID。

返回值
idint
initialize(self: holoscan.core._core.NetworkContext) → None

网络上下文的初始化方法。

property name

网络上下文的名称。

返回值
namestr
setup(self: holoscan.core._core.NetworkContext, arg0: holoscan.core._core.ComponentSpec) → None

网络上下文的设置方法。

property spec
class holoscan.gxf.GXFOperator

基类:holoscan.core._core.Operator

基于 GXF 的算子基类。

属性

args 与组件关联的参数列表。
conditions 与算子关联的条件。
description 描述算子的 YAML 格式字符串。
fragment 算子所属的 Fragment (holoscan.core.Fragment)。
gxf_cid GXF 组件 ID。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_entity_group_name 包含此算子的 GXF EntityGroup 的名称。
gxf_typename 算子的 GXF 类型名称。
id 组件的标识符。
is_metadata_enabled 布尔值,指示此算子所属的 Fragment 是否启用了元数据传输。
metadata 与算子关联的元数据字典 (holoscan.core.MetadataDictionary)。
metadata_policy 与算子关联的元数据策略字典 (holoscan.core.MetadataPolicy)。
name 算子的名称。
operator_type 算子类型。
resources 与算子关联的资源。
spec 与算子关联的算子规范 (holoscan.core.OperatorSpec)。

方法

add_arg(*args, **kwargs) 重载函数。
compute(self, arg0, arg1, arg2) 算子计算方法。
initialize(self) 算子初始化方法。
receiver(self, port_name) 获取输入端口使用的接收器。
resource(self, name) 与算子关联的资源。
setup(self, arg0) 算子设置方法。
start(self) 算子启动方法。
stop(self) 算子停止方法。
transmitter(self, port_name) 获取输出端口使用的发射器。

OperatorType

class OperatorType

基类:pybind11_builtins.pybind11_object

执行器使用的算子类型的枚举类。

  • NATIVE:原生算子。

  • GXF:GXF 算子。

  • VIRTUAL:虚拟算子。(供内部使用,不适用于应用程序作者)

成员

NATIVE

GXF

VIRTUAL

属性

name

value
GXF = <OperatorType.GXF: 1>
NATIVE = <OperatorType.NATIVE: 0>
VIRTUAL = <OperatorType.VIRTUAL: 2>
__init__(self: holoscan.core._core.Operator.OperatorType, value: int) → None
property name
property value
__init__(self: holoscan.gxf._gxf.GXFOperator) → None

基于 GXF 的算子基类。

add_arg(*args, **kwargs)

重载函数。

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

向组件添加参数。

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

向组件添加参数列表。

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

通过 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

向算子添加条件或资源。

这可用于在算子构建完成后向其添加条件或资源。

参数
argholoscan.core.Condition 或 holoscan.core.Resource

要添加的条件或资源。

property args

与组件关联的参数列表。

返回值
arglistholoscan.core.ArgList
compute(self: holoscan.core._core.Operator, arg0: holoscan.core._core.InputContext, arg1: holoscan.core._core.OutputContext, arg2: holoscan.core._core.ExecutionContext) → None

算子计算方法。此方法定义了算子要执行的主要计算。

property conditions

与算子关联的条件。

property description

描述算子的 YAML 格式字符串。

property fragment

算子所属的 Fragment (holoscan.core.Fragment)。

property gxf_cid

GXF 组件 ID。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

property gxf_entity_group_name

包含此算子的 GXF EntityGroup 的名称。

返回值
str

实体组名称。

property gxf_typename

算子的 GXF 类型名称。

返回值
str

算子的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor) 时,标识符设置为 GXF 组件 ID。

返回值
idint
initialize(self: holoscan.core._core.Operator) → None

算子初始化方法。

property is_metadata_enabled

布尔值,指示此算子所属的 Fragment 是否启用了元数据传输。

property metadata

与算子关联的元数据字典 (holoscan.core.MetadataDictionary)。

property metadata_policy

与算子关联的元数据策略字典 (holoscan.core.MetadataPolicy)。

property name

算子的名称。

property operator_type

算子类型。

holoscan.core.Operator.OperatorType 枚举,表示算子的类型。当前实现的两种类型为原生和 GXF。

receiver(self: holoscan.core._core.Operator, port_name: str) → Optional[holoscan::Receiver]

获取输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回值
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

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

与算子关联的资源。

参数
namestr

要检索的资源的名称

返回值
holoscan.core.Resource 或 None

具有给定名称的资源。如果找不到具有给定名称的资源,则返回 None。

property resources

与算子关联的资源。

setup(self: holoscan.core._core.Operator, arg0: holoscan.core._core.OperatorSpec) → None

算子设置方法。

property spec

与算子关联的算子规范 (holoscan.core.OperatorSpec)。

start(self: holoscan.core._core.Operator) → None

算子启动方法。

stop(self: holoscan.core._core.Operator) → None

算子停止方法。

transmitter(self: holoscan.core._core.Operator, port_name: str) → Optional[holoscan::Transmitter]

获取输出端口使用的发射器。

参数
port_namestr

输出端口的名称。

返回值
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发射器。如果端口不存在,则为 None。

class holoscan.gxf.GXFOutputContext

基类:holoscan.core._core.OutputContext

GXF 输出上下文。

方法

emit(self, data[, name])

OutputType
class OutputType

基类:pybind11_builtins.pybind11_object

成员

SHARED_POINTER

GXF_ENTITY

属性

name

value
GXF_ENTITY = <OutputType.GXF_ENTITY: 1>
SHARED_POINTER = <OutputType.SHARED_POINTER: 0>
__init__(self: holoscan.core._core.OutputContext.OutputType, value: int) → None
property name
property value
__init__(self: holoscan.gxf._gxf.GXFOutputContext, context: holoscan.core._core.ExecutionContext, op: holoscan.gxf._gxf.GXFOperator) → None

GXF 输入上下文。

参数
opholoscan.gxf.GXFOperator

拥有此上下文的 GXF 算子。

emit(self: holoscan.core._core.OutputContext, data: object, name: str = '') → None
class holoscan.gxf.GXFResource

基类:holoscan.core._core.Resourceholoscan.gxf._gxf.GXFComponent

基于 GXF 的资源基类。

属性

args 与组件关联的参数列表。
description 描述资源的 YAML 格式字符串。
fragment 资源所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 资源的名称。
resource_type 资源类型。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 资源的初始化方法。
setup(self, arg0) 资源的设置方法。

ResourceType

class ResourceType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ResourceType.GXF: 1>
NATIVE = <ResourceType.NATIVE: 0>
__init__(self: holoscan.core._core.Resource.ResourceType, value: int) → None
property name
property value
__init__(self: holoscan.gxf._gxf.GXFResource) → None

基于 GXF 的资源基类。

add_arg(*args, **kwargs)

重载函数。

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

向组件添加参数。

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

向组件添加参数列表。

property args

与组件关联的参数列表。

返回值
arglistholoscan.core.ArgList
property description

描述资源的 YAML 格式字符串。

property fragment

资源所属的 Fragment。

返回值
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回值
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor) 时,标识符设置为 GXF 组件 ID。

返回值
idint
initialize(self: holoscan.core._core.Resource) → None

资源的初始化方法。

property name

资源的名称。

返回值
namestr
property resource_type

资源类型。

holoscan.core.Resource.ResourceType 枚举,表示资源的类型。当前实现的两种类型为 NATIVE 和 GXF。

setup(self: holoscan.core._core.Resource, arg0: holoscan.core._core.ComponentSpec) → None

资源的设置方法。

property spec
class holoscan.gxf.GXFScheduler

基类:holoscan.core._core.Schedulerholoscan.gxf._gxf.GXFComponent

基于 GXF 的调度器基类。

属性

args 与组件关联的参数列表。
description 描述组件的 YAML 格式字符串。
fragment 调度器所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 调度器的名称。

clock
spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 调度器的初始化方法。
setup(self, arg0) 调度器的设置方法。

__init__(*args, **kwargs)
add_arg(*args, **kwargs)

重载函数。

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

向组件添加参数。

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

向组件添加参数列表。

property args

与组件关联的参数列表。

返回值
arglistholoscan.core.ArgList
property clock
property description

描述组件的 YAML 格式字符串。

property fragment

调度器所属的 Fragment。

返回值
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回值
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor) 时,标识符设置为 GXF 组件 ID。

返回值
idint
initialize(self: holoscan.core._core.Scheduler) → None

调度器的初始化方法。

property name

调度器的名称。

返回值
namestr
setup(self: holoscan.core._core.Scheduler, arg0: holoscan.core._core.ComponentSpec) → None

调度器的设置方法。

property spec
class holoscan.gxf.GXFSystemResourceBase

基类:holoscan.gxf._gxf.GXFResourceholoscan.core._core.Resourceholoscan.gxf._gxf.GXFComponent

被视为 GXF nvidia::gxf::Resource 的类。

这表示诸如 ThreadPool 或 GPUDevice 之类的资源,这些资源可以在 nvidia::gxf::EntityGroup 中的多个实体之间共享。

属性

args 与组件关联的参数列表。
description 描述资源的 YAML 格式字符串。
fragment 资源所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 资源的名称。
resource_type 资源类型。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 资源的初始化方法。
setup(self, arg0) 资源的设置方法。

ResourceType

class ResourceType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ResourceType.GXF: 1>
NATIVE = <ResourceType.NATIVE: 0>
__init__(self: holoscan.core._core.Resource.ResourceType, value: int) → None
property name
property value
__init__(self: holoscan.gxf._gxf.GXFSystemResourceBase) → None

被视为 GXF nvidia::gxf::Resource 的类。

这表示诸如 ThreadPool 或 GPUDevice 之类的资源,这些资源可以在 nvidia::gxf::EntityGroup 中的多个实体之间共享。

add_arg(*args, **kwargs)

重载函数。

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

向组件添加参数。

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

向组件添加参数列表。

property args

与组件关联的参数列表。

返回值
arglistholoscan.core.ArgList
property description

描述资源的 YAML 格式字符串。

property fragment

资源所属的 Fragment。

返回值
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回值
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor) 时,标识符设置为 GXF 组件 ID。

返回值
idint
initialize(self: holoscan.core._core.Resource) → None

资源的初始化方法。

property name

资源的名称。

返回值
namestr
property resource_type

资源类型。

holoscan.core.Resource.ResourceType 枚举,表示资源的类型。当前实现的两种类型为 NATIVE 和 GXF。

setup(self: holoscan.core._core.Resource, arg0: holoscan.core._core.ComponentSpec) → None

资源的设置方法。

property spec
holoscan.gxf.load_extensions(context: int, extension_filenames: list[str] = [], manifest_filenames: list[str] = []) → None

加载 GXF 扩展库

上一个 holoscan.graphs
下一个 holoscan.logger
© 版权所有 2022-2024,NVIDIA。 上次更新于 2025 年 1 月 27 日。