Package ai.djl.modality
Class Output
java.lang.Object
ai.djl.modality.Input
ai.djl.modality.Output
A class stores the generic inference results.
-
Field Summary
Fields inherited from class ai.djl.modality.Input
content, properties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Output
decode
(InputStream is) Decodes the output fromencode()
.boolean
deepEquals
(Object o) Checks for deep equality with another output.byte[]
encode()
Encodes all data in the output to a binary form.int
getCode()
Returns the status code of the output.Returns the status code of the output.void
setCode
(int code) Sets the status code of the output.void
setMessage
(String message) Sets the status message of the output.Methods inherited from class ai.djl.modality.Input
add, add, add, add, add, add, add, addProperty, decodeInputBase, encodeInputBase, get, get, getAsBytes, getAsBytes, getAsNDArray, getAsNDArray, getAsNDList, getAsNDList, getAsString, getAsString, getContent, getContentAsBuffers, getData, getDataAsNDList, getProperties, getProperty, isCancelled, setCancelled, setContent, setProperties, toString
-
Constructor Details
-
Output
public Output()Constructs aOutput
instance. -
Output
Constructs aOutput
with specifiedrequestId
,code
andmessage
.- Parameters:
code
- the status code of the outputmessage
- the status message of the output
-
-
Method Details
-
getCode
public int getCode()Returns the status code of the output.- Returns:
- the status code of the output
-
setCode
public void setCode(int code) Sets the status code of the output.- Parameters:
code
- the status code of the output
-
getMessage
Returns the status code of the output.- Returns:
- the status code of the output
-
setMessage
Sets the status message of the output.- Parameters:
message
- the status message of the output
-
encode
Encodes all data in the output to a binary form.- Overrides:
encode
in classInput
- Returns:
- the binary encoding
- Throws:
IOException
- if it fails to encode part of the data
-
decode
Decodes the output fromencode()
.- Parameters:
is
- the data to decode from- Returns:
- the decoded output
- Throws:
IOException
- if it fails to decode part of the output
-
deepEquals
Checks for deep equality with another output.- Overrides:
deepEquals
in classInput
- Parameters:
o
- the other output.- Returns:
- whether they and all properties, content, and data are equal
-