<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%%------------------------------------------------------------------------------------------------------------
\begin{tcolorbox}[enhanced,width=11cm,frame engine=empty,boxrule=0.1mm,size=title,colback=blue!10!white]
\begin{flushleft}
{\scriptsize
\begin{tabbing}
\texttt{XTensor a, b, c;} \hspace{10.0em} \= // 声明张量tensor \\
\texttt{InitTensor4D(\&amp;a, 2, 2, 3, 4);} \&gt; // a为2*2*3*4的4阶张量 \\
\texttt{InitTensor2D(\&amp;b, 4, 5);} \&gt; // b为4*5的矩阵 \\
\texttt{a.SetDataRand();} \&gt; // 随机初始化a \\
\texttt{b.SetDataRand();} \&gt; // 随机初始化b \\
\texttt{c = MMul(a, b);} \&gt; // 矩阵乘的结果为2*2*3*5的4阶张量
\end{tabbing}
}
\end{flushleft}
\end{tcolorbox}
%%%------------------------------------------------------------------------------------------------------------

</pre></body></html>