shape

Description

Obtains the shape of a Tensor.

Prototype

shape()

Parameters

None

Applicability

Atlas training product

Atlas inference product AI Core

Atlas inference product Vector Core

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Restrictions

None

Returns

The shape. A list of immediates (of type int), Scalars (of type int or uint), or Exprs (of type int or uint).

Example

from tbe import tik 
tik_instance = tik.Tik() 
data_A = tik_instance.Tensor("float16", (128,), name="data_A", scope=tik.scope_ubuf) 
data_A.shape

[128] is returned.