Skip to content

Commit

Permalink
bug fix: TensorView::AsMatrix() must determine needsReshaping correct…
Browse files Browse the repository at this point in the history
…ly if needsSlicing
frankseide committed May 7, 2016
1 parent 7981dd8 commit 5e0f3d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Math/TensorView.cpp
Original file line number Diff line number Diff line change
@@ -363,7 +363,7 @@ shared_ptr<Matrix<ElemType>> TensorView<ElemType>::AsMatrix() const
// which gets reinterpreted back as a [K x J x S x T] tensor
// In the special case of sparse matrices, this split cannot be done. E.g. in the above example, we could only multiply with a [K x I x J] tensor.
let needsSlicing = firstColumn != 0 || numColumns != m_sob->GetNumCols();
let needsReshaping = m_shape[0] != m_sob->GetNumRows() || m_shape[1] != m_sob->GetNumCols();
let needsReshaping = m_shape[0] != m_sob->GetNumRows() || m_shape[1] != numColumns;

// Note: If an output matrix is a view and needs to move to a different device, we will fail later, since the current structure cannot support that.
// As a consequence, some configurations will simply not work currently.

0 comments on commit 5e0f3d7

Please sign in to comment.