create_input

Applicable Products

All processors

Function Usage

Creates 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. The default value is 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) Tensor holder of the input

Restrictions

  • If the parameter type is incorrect, TypeError is thrown.
  • If the input fails to be created, RuntimeError is thrown.