Package ai.djl.modality
Class Output
- java.lang.Object
-
- ai.djl.modality.Input
-
- ai.djl.modality.Output
-
public class Output extends Input
A class stores the generic inference results.
-
-
Field Summary
-
Fields inherited from class ai.djl.modality.Input
content, properties
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Outputdecode(java.io.InputStream is)Decodes the output fromencode().booleandeepEquals(java.lang.Object o)Checks for deep equality with another output.byte[]encode()Encodes all data in the output to a binary form.intgetCode()Returns the status code of the output.java.lang.StringgetMessage()Returns the status code of the output.voidsetCode(int code)Sets the status code of the output.voidsetMessage(java.lang.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
-
-
-
-
Method Detail
-
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
public java.lang.String getMessage()
Returns the status code of the output.- Returns:
- the status code of the output
-
setMessage
public void setMessage(java.lang.String message)
Sets the status message of the output.- Parameters:
message- the status message of the output
-
encode
public byte[] encode() throws java.io.IOExceptionEncodes all data in the output to a binary form.
-
decode
public static Output decode(java.io.InputStream is) throws java.io.IOException
Decodes the output fromencode().- Parameters:
is- the data to decode from- Returns:
- the decoded output
- Throws:
java.io.IOException- if it fails to decode part of the output
-
deepEquals
public boolean deepEquals(java.lang.Object o)
Checks for deep equality with another output.- Overrides:
deepEqualsin classInput- Parameters:
o- the other output.- Returns:
- whether they and all properties, content, and data are equal
-
-