dataflow.alloc_tensor

Applicability

Product

Supported

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

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