private void renderTensor(Optional<Tensor> tensor) throws IOException {
            var t = tensor.orElse(Tensor.Builder.of(TensorType.empty).build());
            byte[] json = JsonFormat.encode(t, settings.tensorOptions);
            generator().writeRawValue(new String(json, StandardCharsets.UTF_8));
        }
Call after all fields in a hit to close the "fields" field of the JSON object
container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java