Skip to content

Commit

Permalink
remove buffer for sparse encoding output
Browse files Browse the repository at this point in the history
Signed-off-by: xinyual <[email protected]>
  • Loading branch information
xinyual committed Sep 12, 2023
1 parent 7f0d576 commit f98f52a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ public Output processOutput(TranslatorContext ctx, NDList list) {
List<Map<String, Float> > listOftokenWeights = new ArrayList<>();
listOftokenWeights.add(tokenWeightsMap);
resultMap.put("response", listOftokenWeights);
ByteBuffer buffer = ndArray.toByteBuffer();
ModelTensor tensor = ModelTensor.builder()
.name(name)
.dataAsMap(resultMap)
.byteBuffer(buffer)
.build();
outputs.add(tensor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ public void test_SparseEncoding_Translator_ProcessOutput() throws URISyntaxExcep
when(ndArray.getFloat(any())).thenReturn(1.0f);
when(ndArray.toLongArray()).thenReturn(new long[]{10000, 10001});
when(ndArray.getName()).thenReturn("output");
ByteBuffer buffer = mock(MappedByteBuffer.class);
when(ndArray.toByteBuffer()).thenReturn(buffer);
List<NDArray> ndArrayList = Collections.singletonList(ndArray);
NDList ndList = new NDList(ndArrayList);
Output output = sparseEncodingTranslator.processOutput(translatorContext, ndList);
Expand Down

0 comments on commit f98f52a

Please sign in to comment.