diff options
author | Ruy Contributors <ruy-eng@google.com> | 2021-11-19 05:25:55 +0300 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2021-11-19 05:26:20 +0300 |
commit | 8c3fd3f266b4a22d542d4aa41329b5018d6b87e1 (patch) | |
tree | 7937fbf88ac560eaa7b64f2a4181b87b1d198a08 | |
parent | 2c5f035bbcbe6aee09eb0b4bd29aa0d52b36e061 (diff) |
Modify use of Eigen::array to use syntax compatible with std::array in c++17.
PiperOrigin-RevId: 410946378
-rw-r--r-- | ruy/test.h | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -1063,19 +1063,17 @@ void EvalEigenTensor(const Matrix<Scalar>& lhs, const Matrix<Scalar>& rhs, : dst->layout().rows()); using DimPair = typename Eigen::Tensor<Scalar, 1, 0, Eigen::Index>::DimensionPair; - Eigen::array<DimPair, 1> contract_dims( + Eigen::array<DimPair, 1> contract_dims{ {DimPair((LhsOrder == Order::kColMajor) ? 1 : 0, - (RhsOrder == Order::kColMajor) ? 0 : 1)}); - Eigen::array<int, 2> shuffle(DstOrder == Order::kColMajor ? 0 : 1, - DstOrder == Order::kColMajor ? 1 : 0); + (RhsOrder == Order::kColMajor) ? 0 : 1)}}; static Eigen::ThreadPool pool(max_num_threads ? max_num_threads : 1); static Eigen::ThreadPoolDevice device(&pool, pool.NumThreads()); if (mul_params.bias()) { TensorBiasType tensor_bias(mul_params.bias(), dst->layout().rows()); - Eigen::array<int, 2> bias_2d_shape(tr ? 1 : dst->layout().rows(), - tr ? dst->layout().rows() : 1); - Eigen::array<int, 2> bcast(tr ? dst->layout().cols() : 1, - tr ? 1 : dst->layout().cols()); + Eigen::array<int, 2> bias_2d_shape{tr ? 1 : dst->layout().rows(), + tr ? dst->layout().rows() : 1}; + Eigen::array<int, 2> bcast{tr ? dst->layout().cols() : 1, + tr ? 1 : dst->layout().cols()}; if (mul_params.clamp_max() == std::numeric_limits<Scalar>::infinity() && mul_params.clamp_min() == -std::numeric_limits<Scalar>::infinity()) { tensor_dst.device(device) = |