Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/ruy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuy Contributors <ruy-eng@google.com>2021-11-19 05:25:55 +0300
committerCopybara-Service <copybara-worker@google.com>2021-11-19 05:26:20 +0300
commit8c3fd3f266b4a22d542d4aa41329b5018d6b87e1 (patch)
tree7937fbf88ac560eaa7b64f2a4181b87b1d198a08
parent2c5f035bbcbe6aee09eb0b4bd29aa0d52b36e061 (diff)
Modify use of Eigen::array to use syntax compatible with std::array in c++17.
PiperOrigin-RevId: 410946378
-rw-r--r--ruy/test.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/ruy/test.h b/ruy/test.h
index d6e74c1..6517519 100644
--- a/ruy/test.h
+++ b/ruy/test.h
@@ -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) =