nus/cs2109s/labs/ps6/imgs/numpy_pytorch.tex

19 lines
1.3 KiB
TeX

\documentclass{article}
\begin{document}
\begin{tabular}{|c|c|p{7cm}|}
\hline
Numpy & PyTorch & Description \\ \hline
\texttt{numpy.zeros()} & \texttt{torch.zeros()} & Initialize a tensor with all elements set to zero \\ \hline
\texttt{numpy.ones()} & \texttt{torch.ones()} & Initialize a tensor with all elements set to one \\ \hline
\texttt{numpy.mean()} & \texttt{torch.mean()} & Compute the mean of a tensor \\ \hline
\texttt{numpy.exp()} & \texttt{torch.exp()} & Compute the exponential of a tensor \\ \hline
\texttt{numpy.sum()} & \texttt{torch.sum()} & Compute the sum of elements in a tensor \\ \hline
\texttt{numpy.std()} & \texttt{torch.std()} & Compute the standard deviation of a tensor \\ \hline
\texttt{numpy.max()} & \texttt{torch.max()} & Compute the maximum of elements in a tensor \\ \hline
\texttt{numpy.min()} & \texttt{torch.min()} & Compute the minimum of elements in a tensor \\ \hline
\texttt{numpy.argmax()} & \texttt{torch.argmax()} & Compute the index of the maximum element in a tensor \\ \hline
\texttt{numpy.argmin()} & \texttt{torch.argmin()} & Compute the index of the minimum element in a tensor \\ \hline
\texttt{numpy.reshape()} & \texttt{torch.reshape()} & Reshape a tensor \\ \hline
\texttt{numpy.transpose()} & \texttt{torch.transpose()} & Transpose a tensor \\ \hline
\end{tabular}
\end{document}