Skip to content

Commit

Permalink
[Docs] Align code lines of TensorFlow types with flytesnacks (#5983)
Browse files Browse the repository at this point in the history
* docs: Align code lines of TensorFlow types with flytesnacks

Signed-off-by: JiaWei Jiang <[email protected]>

* Use gitsha to link the example code

Signed-off-by: JiaWei Jiang <[email protected]>

---------

Signed-off-by: JiaWei Jiang <[email protected]>
  • Loading branch information
JiangJiaWei1103 authored Nov 12, 2024
1 parent 6a740a8 commit 3409ae1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/user_guide/data_types_and_io/tensorflow_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
This document outlines the TensorFlow types available in Flyte, which facilitate the integration of TensorFlow models and datasets in Flyte workflows.

### Import necessary libraries and modules
```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/refs/heads/master/examples/data_types_and_io/data_types_and_io/tensorflow_type.py
```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/9aadec205a6e208c62e29f52873fb3d675965a51/examples/data_types_and_io/data_types_and_io/tensorflow_type.py
:caption: data_types_and_io/tensorflow_type.py
:lines: 2-14
:lines: 3-12
```

## Tensorflow model
Expand All @@ -30,9 +30,9 @@ The `TensorFlowModelTransformer` allows you to save a TensorFlow model to a remo
```{note}
To clone and run the example code on this page, see the [Flytesnacks repo][flytesnacks].
```
```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/refs/heads/master/examples/data_types_and_io/data_types_and_io/tensorflow_type.py
```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/9aadec205a6e208c62e29f52873fb3d675965a51/examples/data_types_and_io/data_types_and_io/tensorflow_type.py
:caption: data_types_and_io/tensorflow_type.py
:lines: 16-33
:lines: 16-34
```

## TFRecord files
Expand All @@ -47,9 +47,9 @@ Flyte supports TFRecord files through the TFRecordFile type, which can handle se
### Usage
The `TensorFlowRecordFileTransformer` enables you to work with single TFRecord files, making it easy to read and write data in TensorFlow's TFRecord format.

```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/refs/heads/master/examples/data_types_and_io/data_types_and_io/tensorflow_type.py
```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/9aadec205a6e208c62e29f52873fb3d675965a51/examples/data_types_and_io/data_types_and_io/tensorflow_type.py
:caption: data_types_and_io/tensorflow_type.py
:lines: 35-45
:lines: 38-48
```

## TFRecord directories
Expand All @@ -66,9 +66,9 @@ Flyte supports directories containing multiple TFRecord files through the `TFRec
The `TensorFlowRecordsDirTransformer` allows you to work with directories of TFRecord files, which is useful for handling large datasets that are split across multiple files.

#### Example
```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/refs/heads/master/examples/data_types_and_io/data_types_and_io/tensorflow_type.py
```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/9aadec205a6e208c62e29f52873fb3d675965a51/examples/data_types_and_io/data_types_and_io/tensorflow_type.py
:caption: data_types_and_io/tensorflow_type.py
:lines: 47-56
:lines: 52-62
```

## Configuration class: `TFRecordDatasetConfig`
Expand Down

0 comments on commit 3409ae1

Please sign in to comment.