提交 7fd123b9 编写于 作者: B buxue

support tensor index data type int64 for tensor get item.

上级 c83e5b01
...@@ -105,10 +105,11 @@ The index operation includes `tuple` and` Tensor`. The following focuses on the ...@@ -105,10 +105,11 @@ The index operation includes `tuple` and` Tensor`. The following focuses on the
- Assignment: Not supported yet. - Assignment: Not supported yet.
- Tensor index: index is `Tensor` - Tensor index: index is `Tensor`
- Value: `tensor_x [index]`, `index` must be `Tensor` of type `int32`, the element value range is `[0, tensor_x.shape[0])`. - Value: `tensor_x [index]`, `index` must be `Tensor` of data type `int32` or `int64`,
the element value range is `[0, tensor_x.shape[0])`.
- Assignment: `tensor_x [index] = U`. - Assignment: `tensor_x [index] = U`.
- `tensor_x` data type must be one of the following: `float16`, `float32`, `int8`, `uint8`. - `tensor_x` data type must be one of the following: `float16`, `float32`, `int8`, `uint8`.
- `index` must be `Tensor` of type `int32`, the element value range is `[0, tensor_x.shape [0])`. - `index` must be `Tensor` of data type `int32`, the element value range is `[0, tensor_x.shape [0])`.
- `U` can be `Number`, `Tensor`, `Tuple` only containing `Number`, `Tuple` only containing `Tensor`. - `U` can be `Number`, `Tensor`, `Tuple` only containing `Number`, `Tuple` only containing `Tensor`.
- Single `Number` or every `Number` in `Tuple` must be the same type as `tensor_x`, ie - Single `Number` or every `Number` in `Tuple` must be the same type as `tensor_x`, ie
When the data type of `tensor_x` is `uint8` or `int8`, the `Number` type should be `int`; When the data type of `tensor_x` is `uint8` or `int8`, the `Number` type should be `int`;
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
- 取值:`tensor_x[True]` - 取值:`tensor_x[True]`
- 赋值:暂不支持。 - 赋值:暂不支持。
- Tensor索引:index为`Tensor` - Tensor索引:index为`Tensor`
- 取值:`tensor_x[index]``index`必须是`int32`类型的`Tensor`,元素取值范围在`[0, tensor_x.shape[0])` - 取值:`tensor_x[index]``index`必须是`int32``int64`类型的`Tensor`,元素取值范围在`[0, tensor_x.shape[0])`
- 赋值:`tensor_x[index]=U` - 赋值:`tensor_x[index]=U`
- `tensor_x`的数据类型必须是下面一种: `float16``float32``int8``uint8` - `tensor_x`的数据类型必须是下面一种: `float16``float32``int8``uint8`
- `index`必须是`int32`类型的`Tensor`,元素取值范围在`[0, tensor_x.shape[0])` - `index`必须是`int32`类型的`Tensor`,元素取值范围在`[0, tensor_x.shape[0])`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册