From a892d91f64ba8aaff46461bf8622b42c451d1239 Mon Sep 17 00:00:00 2001 From: koray kavukcuoglu Date: Thu, 9 Feb 2012 01:38:15 -0500 Subject: documentation for tensor --- doktutorial/index.dok | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/doktutorial/index.dok b/doktutorial/index.dok index 77f52e8..a11a95e 100644 --- a/doktutorial/index.dok +++ b/doktutorial/index.dok @@ -100,7 +100,7 @@ t7> torch.randn( -====== Torch basics: playing with Tensors ====== +====== Torch Basics: Playing with Tensors ====== Ok, now we are ready to actually do something in Torch. Lets start by constructing a vector, say a vector with 5 elements, and filling the @@ -181,7 +181,7 @@ Similarly, row or column-wise operations such as t7> x1=torch.rand(5,5) -t7> x2=torch.sum(x1); +t7> x2=torch.sum(x1,2); t7> print(x2) 2.3450 2.7099 @@ -193,6 +193,41 @@ t7> print(x2) t7> +Naturally, many BLAS operations like matrix-matrix, matrix-vector products +are implemented. We suggest everyone to install ATLAS or MKL libraries since +Torch7 can optionally take advantage with these very efficient and multi-threaded +libraries if they are found in your system. Checkout +[[..:torch:maths|Mathematical operations using tensors.]] for details. + + + +t7> a=torch.ones(5,5) +t7> b=torch.ones(5,2) +t7> =a + 1 1 1 1 1 + 1 1 1 1 1 + 1 1 1 1 1 + 1 1 1 1 1 + 1 1 1 1 1 +[torch.DoubleTensor of dimension 5x5] + +t7> =b + 1 1 + 1 1 + 1 1 + 1 1 + 1 1 +[torch.DoubleTensor of dimension 5x2] + +t7> =torch.mm(a,b) + 5 5 + 5 5 + 5 5 + 5 5 + 5 5 +[torch.DoubleTensor of dimension 5x2] + + ====== Types in Torch7 ====== -- cgit v1.2.3