def _get_tensor_facets(marqo_doc_tensors: Dict[str, Any]) -> List[Dict[str, Any]]:
    """
    Reformat Marqo doc tensors field for API response
    """
    tensor_facets = []
    for tensor_field in marqo_doc_tensors:
        chunks = marqo_doc_tensors[tensor_field][constants.MARQO_DOC_CHUNKS]
        embeddings = marqo_doc_tensors[tensor_field][constants.MARQO_DOC_EMBEDDINGS]
        if len(chunks) != len(embeddings):
            raise api_exceptions.InternalError(
                f"Number of chunks ({len(chunks)}) and number of embeddings ({len(embeddings)}) "
                f"for field {tensor_field} must be the same.")

        for i in range(len(chunks)):
            tensor_facets.append(
                {
                    tensor_field: chunks[i],
                    TensorField.embedding: embeddings[i]
                }
            )

    return tensor_facets

    Reformat Marqo doc tensors field for API response
    
src/marqo/tensor_search/tensor_search.py