产品 |
是否支持 |
---|---|
√ |
|
x |
|
x |
|
x |
|
x |
构造TensorDesc。
1 | __init__(dtype: DataType, shape: Union[List[int], Tuple[int]]) |
参数名 |
数据类型 |
取值说明 |
---|---|---|
dtype |
表示Tensor数据类型。 |
|
shape |
Union[List[int], Tuple[int]] |
表示Tensor的shape的描述。 |
正常情况下返回TensorDesc的实例。
传入数据类型错误情况下会抛出TypeError或ValueError异常。
1 2 | from llm_datadist import TensorDesc, DataType tensor_desc = TensorDesc(DataType.DT_FLOAT, [1,2]) |
无