<!--
This file is generated by a tool. Do not edit directly.
For open-source contributions the docs will be updated automatically.
-->

*Last updated: 2023-03-16.*

<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tf_quant_finance.experimental.io" />
<meta itemprop="path" content="Stable" />
</div>

# Module: tf_quant_finance.experimental.io

<!-- Insert buttons and diff -->

<table class="tfo-notebook-buttons tfo-api" align="left">
</table>

<a target="_blank" href="https://github.com/paolodelia99/tf-quant-finance/blob/main/tf_quant_finance/experimental/io.py">View source</a>



Utilities to serialize and deserialize dictionaries of numpy arrays.


This module defines generic reader and writer for serialized data as well as
specialized methods to export collections of numpy arrays to files.
The latter is based on `TFRecords` format. The main difference is
that instead of directly storing elements in `FloatList` (or `IntList` etc)
protos, it first serializes them to bytes and then stores them as a single
element `BytesList`. This is necessary to improve deserialization performance
when we have large arrays.

## Classes

[`class ArrayDictReader`](../../tf_quant_finance/experimental/io/ArrayDictReader.md): Iterator over the data serialized by `ArrayDictWriter`.

[`class ArrayDictWriter`](../../tf_quant_finance/experimental/io/ArrayDictWriter.md): Writer to write dictionaries of numpy arrays in binary format.

## Functions

[`decode_array(...)`](../../tf_quant_finance/experimental/io/decode_array.md): Decodes a bytestring into a numpy array.

[`encode_array(...)`](../../tf_quant_finance/experimental/io/encode_array.md): Encodes a numpy array using `TensorProto` protocol buffer.

