Package com.yahoo.tensor.serialization
Class JsonFormat
- java.lang.Object
-
- com.yahoo.tensor.serialization.JsonFormat
-
public class JsonFormat extends java.lang.Object
Writes tensors on the JSON format used in Vespa tensor document fields: A JSON map containing a 'cells' or 'values' array. See https://docs.vespa.ai/documentation/reference/document-json-format.html- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description JsonFormat()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Tensor
decode(TensorType type, byte[] jsonTensorValue)
Deserializes the given tensor from JSON formatstatic byte[]
encode(Tensor tensor)
Serializes the given tensor value into JSON formatstatic byte[]
encodeWithType(Tensor tensor)
Serializes the given tensor type and value into JSON format
-
-
-
Method Detail
-
encode
public static byte[] encode(Tensor tensor)
Serializes the given tensor value into JSON format
-
encodeWithType
public static byte[] encodeWithType(Tensor tensor)
Serializes the given tensor type and value into JSON format
-
decode
public static Tensor decode(TensorType type, byte[] jsonTensorValue)
Deserializes the given tensor from JSON format
-
-