create_input

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

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.