create_input
Function Usage
Create a graph input.
Prototype
1 | create_input(index: int, *, name: Optional[str] = None, type_str: Optional[InputType] = InputType.DATA, data_type: Optional[DataType] = DataType.DT_FLOAT, format: Optional[Format] = Format.FORMAT_ND, shape: Optional[List[int]] = None) -> TensorHolder |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
index |
Input |
Input index. |
name |
Input |
(Optional) Enter a name. The default value is input_{index}. |
type_str |
Input |
(Optional) Input type. The default value is DATA. For details, see InputType. |
data_type |
Input |
(Optional) Data type. Defaults to DT_FLOAT. For details, see DataType. |
format |
Input |
(Optional) Data format. The default value is FORMAT_ND. For details, see Format. |
shape |
Input |
(Optional) Shape dimension list. None indicates a scalar. |
Returns
(TensorHolder) indicates the input tensor holder.
Constraints
- Throws TypeError if the parameter type is incorrect.
- If the input fails to be created, RuntimeError is thrown.
Parent topic: GraphBuilder