dataflow.alloc_tensor

Applicable Products

Product

Supported

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Function Description

Allocates a dataflow tensor based on the shape, data type, and alignment size.

Prototype

1
alloc_tensor(shape: Union[List[int], Tuple[int]], dtype, align:Optional[int] = 64) -> Tensor

Parameters

Parameter

Input/Output

Description

shape

Input

Shape of a tensor.

dtype

Input

Data type of a tensor.

align

Input

Size of the allocated memory address alignment. Values: [32, 64, 128, 256, 512, 1024]. Default value: 64.

Returns

Tensor instances are returned.

Exception Handling

If no tensor pointer can be allocated, None is returned.

Constraints

None