admin管理员组文章数量:1414613
I want to have a downstream component that has an optional dsl.Dataset
input. That optional input is the output of an upstream task within a dsl.If
. All of these are within a dsl.ParallelFor
, so that I can consume everything with a dsl.Collected
afterwards. Something like:
from typing import Optional
from kfp import dsl
@dslponent
def component_A_op() -> dsl.Dataset:
return Dataset()
@dslponent
def component_B_op(a_data: Optional[Dataset] = None) -> Dataset:
if a_data:
return Dataset()
else:
return Dataset()
@dslponent
def component_C_op(datas: List[Dataset]):
pass
@dsl.pipeline()
def pipeline:
with dsl.ParallelFor(items=["item_1", "item_2"]) as _items:
with dsl.If(_items == "item_1"):
component_A = component_A_op()
component_B = component_B_op(
a_data= # if component_A is present then component_A.output else None
)
component_C = component_C_op(datas=dsl.Collected(component_B)
Is this possible?
本文标签:
版权声明:本文标题:google cloud vertex ai - Is this possible: Use output of upstream component within a dsl.If; otherwise, use None - Stack Overflo 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745168756a2645843.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论