dataflow.alloc_tensor
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
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
Parent topic: Graph Construction APIs