Use of functions
This is the definition of the function, the declaration of the keyword + defined function name + the name of the formal parameter, the blogger returns two values, the function of the specific functions in the back again
This is the initialization of a 5x2 matrix, and the initial value is 1. Here's a way to initialize the matrix.
This is to declare a 2x5 matrix before calling the fill () method whose values are all initialized to 4.
Input a A A, a matrix into the addtensors function, note that here is the argument, the previous definition of a, B is a formal parameter, this is a bit C base should be divided into clear it. The printed result is a matrix that returns a matrix and AXB.
This kind of writing is more like Matlab, and the returned a and AXB are assigned to c,d in order.
Cuda's tensor
Sorry, my computer is not Nvidia's video card, here to fill it up later, do not see the results of the operation
Here is to call the Cuda () function, and then calculate the AXB matrix of the flight operation on it. The beginning of the Require ' Cutorch ' is the import Cuda operation package, similar to the C language include.
Next chapter, Getting started with the topic-Neural network
Torch7 Deep Learning Tutorial (iii)