static void serializeTensorAddresses(JsonGenerator generator, Tensor tensor) throws IOException {
        TensorType tensorType = tensor.type();
        generator.writeArrayFieldStart(TensorRemoveUpdateReader.TENSOR_ADDRESSES);
        for (Map.Entry<TensorAddress, Double> cell : tensor.cells().entrySet()) {
            generator.writeStartObject();
            for (int i = 0; i < tensorType.dimensions().size(); i++) {
                generator.writeStringField(tensorType.dimensions().get(i).name(), cell.getKey().label(i));
            }
            generator.writeEndObject();
        }
        generator.writeEndArray();
    }
@author Steinar Knutsen
@author Vegard Sjonfjell
document/src/main/java/com/yahoo/document/json/JsonSerializationHelper.java