Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
adding error message when attempting to use Large tensor with linalg_…
Browse files Browse the repository at this point in the history
…syevd
  • Loading branch information
Rohit Kumar Srivastava committed Jul 28, 2020
1 parent d009345 commit 79f11fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3rdparty/mshadow/mshadow/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ const float kPi = 3.1415926f;
typedef int32_t index_t;
#endif

const index_t kInt32Limit = (int64_t{1} << 31) - 1;

#ifdef _WIN32
/*! \brief openmp index for windows */
typedef int64_t openmp_index_t;
Expand Down
3 changes: 3 additions & 0 deletions src/operator/tensor/la_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,14 @@ inline bool DetType(const nnvm::NodeAttrs& attrs,
inline bool LaEigFactShape(const nnvm::NodeAttrs& attrs,
mxnet::ShapeVector* in_attrs,
mxnet::ShapeVector* out_attrs) {
using namespace mshadow;
CHECK_EQ(in_attrs->size(), 1);
CHECK_EQ(out_attrs->size(), 2);
const mxnet::TShape& in_a = (*in_attrs)[0];
const mxnet::TShape& out_u = (*out_attrs)[0];
const mxnet::TShape& out_l = (*out_attrs)[1];
CHECK_LE(in_a.Size(), kInt32Limit)
<< "Large tensors are not supported by Linear Algebra operator syevd";
if ( in_a.ndim() >= 2 ) {
// Forward shape inference.
const int ndim(in_a.ndim());
Expand Down

0 comments on commit 79f11fc

Please sign in to comment.