ReinterpretCast

Product Support

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference product's AI Core

Atlas inference product's Vector Core

Atlas training products

Function

Reinterprets the current tensor as a new type specified by the user. The converted tensor has the same address and content as the original tensor, and the tensor size (number of bytes) remains unchanged.

Prototype

1
2
template <typename CAST_T> 
__aicore__ inline LocalTensor<CAST_T> ReinterpretCast() const

Parameters

Table 1 Template parameters

Parameter

Description

CAST_T

New type specified by the user.

Returns

Tensor after reinterpretation.

Restrictions

None

Example

For details, see Example.