Added access to the unerlying raw data of a tnsor slice/chip whenever possible

This commit is contained in:
Benoit Steiner
2014-10-17 15:33:27 -07:00
parent 7acd38d19e
commit f786897e4b
4 changed files with 126 additions and 5 deletions

View File

@@ -157,7 +157,14 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device>
}*/
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar* data() const { return NULL; }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar* data() const {
Scalar* result = m_impl.data();
if (DimId == NumDims && result) {
return result + m_inputOffset;
} else {
return NULL;
}
}
protected:
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const