You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@singa.apache.org by "wangwei (JIRA)" <ji...@apache.org> on 2016/06/27 12:14:51 UTC

[jira] [Created] (SINGA-207) Update Tensor functions for matrices

wangwei created SINGA-207:
-----------------------------

             Summary: Update Tensor functions for matrices
                 Key: SINGA-207
                 URL: https://issues.apache.org/jira/browse/SINGA-207
             Project: Singa
          Issue Type: Improvement
            Reporter: wangwei


Operations like AddRow, SumRows, AddColumn, SumColumns, SoftMax, MultRow, DivRow, etc. are specific for matrices. 
However, for CNN (and some other) models, the tensors usually have 4 dimensions (batch, channel, height and width). To use the above functions, we have to reshape the tensors into matrices and reshape them back after calling these functions. To make it easy to use these functions, this ticket would update the function API, e.g.,
{code}
void AddRow(const Tensor& row, Tensor* mat);    // old API, the mat must be a matrix
void AddRow(const Tensor& row, Tensor* mat, int axis = 1);  // new API, the mat could have nDim() > 2.
{code}
The axis argument indicates that the dimension [0, axis) would be reshaped as the row dimension, and [axis, ...) would be reshaped as the column dimension.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)