Class ModelTensor
java.lang.Object
org.opensearch.ml.common.output.model.ModelTensor
- All Implemented Interfaces:
org.opensearch.core.common.io.stream.Writeable,org.opensearch.core.xcontent.ToXContent,org.opensearch.core.xcontent.ToXContentObject
public class ModelTensor
extends Object
implements org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContentObject
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionModelTensor(String name, Number[] data, long[] shape, MLResultDataType dataType, ByteBuffer byteBuffer, String result, Map<String, ?> dataAsMap) ModelTensor(String name, String result) ModelTensor(org.opensearch.core.common.io.stream.StreamInput in) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()protected booleanbooleanNumber[]getData()getName()long[]getShape()inthashCode()static ModelTensorparser(org.opensearch.core.xcontent.XContentParser parser) voidsetByteBuffer(ByteBuffer byteBuffer) voidvoidsetDataAsMap(Map<String, ?> dataAsMap) voidsetDataType(MLResultDataType dataType) voidvoidvoidsetShape(long[] shape) toString()org.opensearch.core.xcontent.XContentBuildertoXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) voidwriteTo(org.opensearch.core.common.io.stream.StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensearch.core.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME_FIELD
- See Also:
-
DATA_TYPE_FIELD
- See Also:
-
SHAPE_FIELD
- See Also:
-
DATA_FIELD
- See Also:
-
BYTE_BUFFER_FIELD
- See Also:
-
BYTE_BUFFER_ARRAY_FIELD
- See Also:
-
BYTE_BUFFER_ORDER_FIELD
- See Also:
-
RESULT_FIELD
- See Also:
-
DATA_AS_MAP_FIELD
- See Also:
-
-
Constructor Details
-
ModelTensor
public ModelTensor(String name, Number[] data, long[] shape, MLResultDataType dataType, ByteBuffer byteBuffer, String result, Map<String, ?> dataAsMap) -
ModelTensor
-
ModelTensor
- Throws:
IOException
-
-
Method Details
-
toXContent
public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.opensearch.core.xcontent.ToXContent- Throws:
IOException
-
parser
public static ModelTensor parser(org.opensearch.core.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
writeTo
- Specified by:
writeToin interfaceorg.opensearch.core.common.io.stream.Writeable- Throws:
IOException
-
builder
-
getName
-
getData
-
getShape
public long[] getShape() -
getDataType
-
getByteBuffer
-
getResult
-
getDataAsMap
-
setName
-
setData
-
setShape
public void setShape(long[] shape) -
setDataType
-
setByteBuffer
-
setResult
-
setDataAsMap
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-