Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f0450f3

Browse files
nateboschcommit-bot@chromium.org
authored andcommitted
Remove a usage of the quiver package
The quiver package has very little usage in the SDK. Drop the only usage outside of the nnbd migration tool to clear a path towards removing the dependency from the SDK entirely. Change-Id: I54b14d6e887fe6e6b067793e7ee9480793893c27 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148788 Commit-Queue: Nate Bosch <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]> Auto-Submit: Nate Bosch <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent dbc41af commit f0450f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/analysis_server/lib/src/services/completion/dart/language_model.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'dart:io';
77
import 'dart:typed_data';
88

99
import 'package:path/path.dart' as path;
10-
import 'package:quiver/check.dart';
1110
import 'package:tflite_native/tflite.dart' as tfl;
1211

1312
/// Interface to TensorFlow-based Dart language model for next-token prediction.
@@ -41,9 +40,10 @@ class LanguageModel {
4140

4241
// Get lookback size from model input tensor shape.
4342
final tensorShape = interpreter.getInputTensors().single.shape;
44-
checkArgument(tensorShape.length == 2 && tensorShape.first == 1,
45-
message:
46-
'tensor shape $tensorShape does not match the expected [1, X]');
43+
if (tensorShape.length != 2 || tensorShape.first != 1) {
44+
throw ArgumentError(
45+
'tensor shape $tensorShape does not match the expected [1, X]');
46+
}
4747
final lookback = tensorShape.last;
4848

4949
return LanguageModel._(interpreter, word2idx, idx2word, lookback);

0 commit comments

Comments
 (0)