inspect static method

Future<Map<String, List<int>>> inspect(
  1. File file
)

Returns a map of tensor name to shape for every tensor in a checkpoint file. Reads and parses the entire file, then discards the tensor data, retaining only names and shapes. Useful for debugging and validation.

Implementation

static Future<Map<String, List<int>>> inspect(File file) async {
  final bytes = await file.readAsBytes();
  final records = _parseCheckpoint(bytes);
  return {for (final r in records) r.name: r.shape};
}