 Cast - Maple Help

DeepLearning/Tensor/Cast

cast Tensor to new type Calling Sequence Cast(x, t) Parameters

 x - Tensor t - one of string,truefalse,integer,integer,float,float,complex, or complex Description

 • The Cast(x,t) command constructs a Tensor by casting x to the specified type t. Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\mathrm{t1}≔\mathrm{Constant}\left(\left[\left[86,-15,77\right],\left[-19,-89,-80\right],\left[-53,66,-19\right]\right],\mathrm{datatype}={\mathrm{float}}_{4}\right)$
 ${\mathrm{t1}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Shape: \left[3, 3\right]}}\\ {\mathrm{Data Type: float\left[4\right]}}\end{array}\right]$ (1)
 > $\mathrm{Cast}\left(\mathrm{t1},{\mathrm{complex}}_{8}\right)$
 $\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Shape: \left[3, 3\right]}}\\ {\mathrm{Data Type: complex\left[8\right]}}\end{array}\right]$ (2) Compatibility

 • The DeepLearning/Tensor/Cast command was introduced in Maple 2018.