dataflow.FlowData
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
Function Description
Indicates data nodes in a DataFlow graph. Each FlowData corresponds to an input.
Prototype
1 | FlowData(data_cls=Tensor, schema:Optional[TensorDesc]=None, name=None) |
Parameters
Parameter |
Data Type |
Description |
|---|---|---|
data_cls |
class |
Currently, only the default Tensor is supported, indicating that FlowData receives tensor data. |
schema |
Optional[TensorDesc] |
Description of data_cls. Currently, data_cls supports only tensors, so the value of schema is TensorDesc. |
name |
str |
Node name. The framework automatically ensures that the node name is unique. If this parameter is not set, names such as FlowData, FlowData_1, FlowData_2, and the like will be automatically generated. |
Returns
None is returned in normal scenarios.
If raise DfException is returned, the parameter type is incorrect. You can catch DfException and retrieve its error_code and message attributes to check the specific error code and error details. For details, see DataFlow Error Codes.
Examples
1 2 3 4 5 6 7 8 9 | import dataflow as df # Create an input node without specifying the data type and name. If you do not specify the name, the framework assigns a unique name FlowData FlowData_1 to the node. data = df.FlowData() # Create an input node that accepts the int32 data type and sets the shape to [1]. data = df.FlowData(schema=df.TensorDesc(df.DT_INT32, [1])) # Create an input node named data0 without specifying the data type. data = df.FlowData(name="data0") # Create an input node whose data type is int32, shape is [1], and name is data0. data = df.FlowData(schema=df.TensorDesc(df.DT_INT32, [1]), name="data0") |
Constraints
None