获取Tensor形状。
shape()
无。
Atlas 200/300/500 推理产品
Atlas 训练系列产品
Atlas推理系列产品AI Core
Atlas推理系列产品Vector Core
Atlas A2训练系列产品
Atlas 200I/500 A2推理产品
无
shape形状: List类型,List中的元素为立即数(int)、Scalar(int、uint)或Expr(int、uint)。
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]