tensorflow/compiler/mlir/tfrt/transforms/lmhlo_to_gpu/convolution_pattern.cc
// Converts (via narrowing) a Span<const int64_t> to a vector<int>, and checks
// that the elements have not changed due to the conversion.
Converts (via narrowing) a Span to a vector, and checks
that the elements have not changed due to the conversion.
Converts ( via narrowing ) a Span to a vector and checks that the elements have not changed due to the conversion .
std::vector<int> CheckedNarrowing(absl::Span<const int64_t> wide_span) {
  std::vector<int> narrow_vector(wide_span.size());
  std::transform(
      wide_span.cbegin(), wide_span.cend(), narrow_vector.begin(),
      [](int64_t wide) {
        int narrow = wide;
        assert(narrow == wide &&
               "checked narrowing failed; values not equal post-conversion");
        return narrow;
      });
  return narrow_vector;
}
std :: vector < int > CheckedNarrowing ( absl :: Span < const int64_t > wide_span ) { std :: vector < int > narrow_vector ( wide_span . size ( ) ) ; std :: transform ( wide_span . cbegin ( ) , wide_span . cend ( ) , narrow_vector . begin ( ) , [ ] ( int64_t wide ) { int narrow = wide ; assert ( narrow == wide && " " ) ; return narrow ; } ) ; return narrow_vector ; }
Converts (via narrowing) a Span<const int64_t> to a vector<int>, and checks
that the elements have not changed due to the conversion.
Converts ( via narrowing ) a Span<const int64_t > to a vector<int > and checks that the elements have not changed due to the conversion .