Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ opts, runOpts, new BytePointer(exportDir), new PointerPointer(tags),
}

private static void validateTags(String[] tags) {
if (tags == null || tags.length == 0 || Arrays.stream(tags).anyMatch(t -> t == null || t.isEmpty())) {
if (tags == null || Arrays.stream(tags).anyMatch(t -> t == null || t.isEmpty())) {
throw new IllegalArgumentException("Invalid tags: " + Arrays.toString(tags));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,7 @@ public void cannotExportMultipleFunctionsWithSameSignatureKey() throws IOExcepti
@Test
public void cannotExportOrImportInvalidTags() {
assertThrows(IllegalArgumentException.class, () ->
SavedModelBundle.loader("/").withTags()
);
assertThrows(IllegalArgumentException.class, () ->
SavedModelBundle.loader("/").withTags(new String[]{})
SavedModelBundle.loader("/").withTags(null)
);
assertThrows(IllegalArgumentException.class, () ->
SavedModelBundle.loader("/").withTags(new String[]{"tag", null})
Expand All @@ -274,10 +271,7 @@ public void cannotExportOrImportInvalidTags() {
SavedModelBundle.loader("/").withTags(new String[]{"tag", ""})
);
assertThrows(IllegalArgumentException.class, () ->
SavedModelBundle.exporter("/").withTags()
);
assertThrows(IllegalArgumentException.class, () ->
SavedModelBundle.exporter("/").withTags(new String[]{})
SavedModelBundle.exporter("/").withTags(null)
);
assertThrows(IllegalArgumentException.class, () ->
SavedModelBundle.exporter("/").withTags(new String[]{"tag", null})
Expand Down