diff options
author | Arne H Juul <arnej27959@users.noreply.github.com> | 2021-03-09 13:30:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-09 13:30:59 +0100 |
commit | 551b40f0c7d89d207e058abdf697f61a76c1d557 (patch) | |
tree | ae8ce4e73ac63335540c949a012fd4184c011637 | |
parent | 0bb86da8d2e547ff7f1790100ba6db8d32220030 (diff) | |
parent | 472cb7eead599f16a98d4abede0b902fae31dd32 (diff) |
Merge pull request #16853 from vespa-engine/arnej/move-assserts-on-cell-type
Arnej/move asserts on cell type
4 files changed, 5 insertions, 4 deletions
diff --git a/eval/src/vespa/eval/instruction/dense_cell_range_function.cpp b/eval/src/vespa/eval/instruction/dense_cell_range_function.cpp index 4c655c67747..78fecbd10d8 100644 --- a/eval/src/vespa/eval/instruction/dense_cell_range_function.cpp +++ b/eval/src/vespa/eval/instruction/dense_cell_range_function.cpp @@ -31,6 +31,7 @@ DenseCellRangeFunction::DenseCellRangeFunction(const ValueType &result_type, _offset(offset), _length(length) { + assert(result_type.cell_type() == child.result_type().cell_type()); } DenseCellRangeFunction::~DenseCellRangeFunction() = default; diff --git a/eval/src/vespa/eval/instruction/remove_trivial_dimension_optimizer.cpp b/eval/src/vespa/eval/instruction/remove_trivial_dimension_optimizer.cpp index bd0534e1d7d..06c3fb886b5 100644 --- a/eval/src/vespa/eval/instruction/remove_trivial_dimension_optimizer.cpp +++ b/eval/src/vespa/eval/instruction/remove_trivial_dimension_optimizer.cpp @@ -30,9 +30,9 @@ RemoveTrivialDimensionOptimizer::optimize(const TensorFunction &expr, Stash &sta const TensorFunction &child = reduce->child(); if (expr.result_type().has_dimensions() && aggr::is_ident(reduce->aggr()) && - is_trivial_dim_list(child.result_type(), reduce->dimensions())) + is_trivial_dim_list(child.result_type(), reduce->dimensions()) && + (expr.result_type().cell_type() == child.result_type().cell_type())) { - assert(expr.result_type().cell_type() == child.result_type().cell_type()); return ReplaceTypeFunction::create_compact(expr.result_type(), child, stash); } } diff --git a/eval/src/vespa/eval/instruction/sparse_full_overlap_join_function.cpp b/eval/src/vespa/eval/instruction/sparse_full_overlap_join_function.cpp index 85ccfd69871..2072555bb3d 100644 --- a/eval/src/vespa/eval/instruction/sparse_full_overlap_join_function.cpp +++ b/eval/src/vespa/eval/instruction/sparse_full_overlap_join_function.cpp @@ -107,12 +107,12 @@ bool SparseFullOverlapJoinFunction::compatible_types(const ValueType &res, const ValueType &lhs, const ValueType &rhs) { if ((lhs.cell_type() == rhs.cell_type()) && + (res.cell_type() == lhs.cell_type()) && is_sparse_like(lhs) && is_sparse_like(rhs) && (res.count_mapped_dimensions() == lhs.count_mapped_dimensions()) && (res.count_mapped_dimensions() == rhs.count_mapped_dimensions())) { assert(is_sparse_like(res)); - assert(res.cell_type() == lhs.cell_type()); return true; } return false; diff --git a/eval/src/vespa/eval/instruction/sparse_no_overlap_join_function.cpp b/eval/src/vespa/eval/instruction/sparse_no_overlap_join_function.cpp index e8e0bc212e0..9c82b1f7bcd 100644 --- a/eval/src/vespa/eval/instruction/sparse_no_overlap_join_function.cpp +++ b/eval/src/vespa/eval/instruction/sparse_no_overlap_join_function.cpp @@ -113,11 +113,11 @@ bool SparseNoOverlapJoinFunction::compatible_types(const ValueType &res, const ValueType &lhs, const ValueType &rhs) { if ((lhs.cell_type() == rhs.cell_type()) && + (res.cell_type() == lhs.cell_type()) && is_sparse_like(lhs) && is_sparse_like(rhs) && (res.count_mapped_dimensions() == (lhs.count_mapped_dimensions() + rhs.count_mapped_dimensions()))) { assert(is_sparse_like(res)); - assert(res.cell_type() == lhs.cell_type()); return true; } return false; |