Skip to content

Commit 880a4a0

Browse files
committed
remove buffer for sparse encoding output
1 parent 9f99e07 commit 880a4a0

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/sparse_encoding/SparseEncodingTranslator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,9 @@ public Output processOutput(TranslatorContext ctx, NDList list) {
8484
List<Map<String, Float> > listOftokenWeights = new ArrayList<>();
8585
listOftokenWeights.add(tokenWeightsMap);
8686
resultMap.put("response", listOftokenWeights);
87-
ByteBuffer buffer = ndArray.toByteBuffer();
8887
ModelTensor tensor = ModelTensor.builder()
8988
.name(name)
9089
.dataAsMap(resultMap)
91-
.byteBuffer(buffer)
9290
.build();
9391
outputs.add(tensor);
9492
}

ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/sparse_encoding/SparseEncodingModelTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ public void test_SparseEncoding_Translator_ProcessOutput() throws URISyntaxExcep
140140
when(ndArray.getFloat(any())).thenReturn(1.0f);
141141
when(ndArray.toLongArray()).thenReturn(new long[]{10000, 10001});
142142
when(ndArray.getName()).thenReturn("output");
143-
ByteBuffer buffer = mock(MappedByteBuffer.class);
144-
when(ndArray.toByteBuffer()).thenReturn(buffer);
145143
List<NDArray> ndArrayList = Collections.singletonList(ndArray);
146144
NDList ndList = new NDList(ndArrayList);
147145
Output output = sparseEncodingTranslator.processOutput(translatorContext, ndList);

0 commit comments

Comments
 (0)