SetValue
Product Support
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Sets a value in the LocalTensor.
This API is supported only when the TPosition of the LocalTensor is VECIN, VECCALC, or VECOUT.
Prototype
1 2 | template <typename T1> __aicore__ inline __inout_pipe__(S) void SetValue(const uint32_t index, const T1 value) const |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
index |
Input |
LocalTensor index. The unit is element. |
value |
Input |
Value to be set. |
Returns
None
Restrictions
Do not use SetValue to assign values to the LocalTensor frequently. Otherwise, the performance deteriorates. If a large number of values need to be assigned, select basic APIs for data padding or high-level APIs for data padding (Pad and Broadcast) based on the actual situation. If incremental sequences need to be generated, select Arange.
Example
For details, see Example.