You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by zh...@apache.org on 2020/07/29 01:54:54 UTC
[incubator-mxnet] branch master updated: Cherry-pick large tensor
support from #18752. (#18804)
This is an automated email from the ASF dual-hosted git repository.
zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new e9829e7 Cherry-pick large tensor support from #18752. (#18804)
e9829e7 is described below
commit e9829e71a7f536d0fc78a0faf96f31336987770e
Author: Joe Evans <gi...@250hacks.net>
AuthorDate: Tue Jul 28 18:53:29 2020 -0700
Cherry-pick large tensor support from #18752. (#18804)
Co-authored-by: Joe Evans <jo...@amazon.com>
---
CONTRIBUTORS.md | 1 +
src/operator/tensor/la_op-inl.h | 11 ++++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index f63b241..4146d45 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -254,6 +254,7 @@ List of Contributors
* [Connor Goggins](https://github.com/connorgoggins)
* [Wei Chu](https://github.com/waytrue17)
* [Yang Shi](https://github.com/ys2843)
+* [Joe Evans](https://github.com/josephevans)
Label Bot
---------
diff --git a/src/operator/tensor/la_op-inl.h b/src/operator/tensor/la_op-inl.h
index d580cce..7a5a602 100644
--- a/src/operator/tensor/la_op-inl.h
+++ b/src/operator/tensor/la_op-inl.h
@@ -36,9 +36,10 @@ using namespace mshadow;
// Copies lower/upper triangular part to upper/lower, i.e. to the opposite side.
struct CopyTriangularToOppositeSide {
template<typename DType>
- MSHADOW_XINLINE static void Map(int i, int matrix_size, int stride, DType* data, bool to_lower) {
+ MSHADOW_XINLINE static void Map(index_t i, size_t matrix_size, index_t stride,
+ DType* data, bool to_lower) {
// Below computation works even when we are dealing with a batch of matrices.
- const int row((i % matrix_size) / stride), col(i % stride);
+ const index_t row((i % matrix_size) / stride), col(i % stride);
if (row > col) {
if (to_lower) {
data[i] = data[i + (col - row) * (stride - 1)];
@@ -52,9 +53,9 @@ struct CopyTriangularToOppositeSide {
// Zero's lower/upper triangular part of a matrix.
struct ZeroTriangular {
template<typename DType>
- MSHADOW_XINLINE static void Map(int i, int matrix_size, int stride, DType* data,
- bool zero_lower) {
- const int row((i % matrix_size) / stride), col(i % stride);
+ MSHADOW_XINLINE static void Map(index_t i, size_t matrix_size, index_t stride,
+ DType* data, bool zero_lower) {
+ const index_t row((i % matrix_size) / stride), col(i % stride);
if ((!zero_lower && (row < col)) || (zero_lower && (row > col))) data[i] = 0;
}
};