Full Code of lanpa/tensorboardX for AI

master ca5072b12f22 cached
155 files
1.0 MB
465.8k tokens
406 symbols
1 requests
Download .txt
Showing preview only (1,088K chars total). Download the full file or copy to clipboard to get everything.
Repository: lanpa/tensorboardX
Branch: master
Commit: ca5072b12f22
Files: 155
Total size: 1.0 MB

Directory structure:
gitextract_40nonxya/

├── .codecov.yml
├── .flake8
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature-requests-or-general-questions.md
│   └── workflows/
│       ├── build-wheel.yml
│       ├── publish-pypi.yml
│       └── test-matrix.yml
├── .gitignore
├── .readthedocs.yaml
├── HISTORY.rst
├── LICENSE
├── MANIFEST.in
├── README.md
├── compile.sh
├── docs/
│   ├── Makefile
│   ├── conf.py
│   ├── index.rst
│   ├── requirements.txt
│   ├── tensorboard.rst
│   ├── tutorial.rst
│   ├── tutorial_zh.rst
│   └── utils.rst
├── examples/
│   ├── RUN_AFTER_PIP_INSTALL
│   ├── __init__.py
│   ├── chainer/
│   │   ├── extension_logger/
│   │   │   ├── net.py
│   │   │   ├── train_dcgan.py
│   │   │   ├── updater.py
│   │   │   ├── visualize.py
│   │   │   └── writetensorboard.py
│   │   └── plain_logger/
│   │       ├── data.py
│   │       ├── net.py
│   │       └── train_vae.py
│   ├── create_wit_samples.py
│   ├── demo.py
│   ├── demo_beholder.py
│   ├── demo_comet.py
│   ├── demo_custom_scalars.py
│   ├── demo_embedding.py
│   ├── demo_global_writer.py
│   ├── demo_graph.py
│   ├── demo_hogwild.py
│   ├── demo_hparams.py
│   ├── demo_matplotlib.py
│   ├── demo_mesh.py
│   ├── demo_multiple_embedding.py
│   ├── demo_multiprocessing.py
│   ├── demo_nvidia_smi.py
│   ├── demo_onnx.py
│   ├── demo_openvino.py
│   ├── demo_purge.py
│   ├── global_1.py
│   ├── global_2.py
│   ├── mobilenetv2.xml
│   └── processed.cleveland.data
├── pyproject.toml
├── run_pytest.sh
├── tensorboardX/
│   ├── __init__.py
│   ├── comet_utils.py
│   ├── crc32c.py
│   ├── embedding.py
│   ├── event_file_writer.py
│   ├── global_writer.py
│   ├── onnx_graph.py
│   ├── openvino_graph.py
│   ├── proto/
│   │   ├── __init__.py
│   │   ├── api.proto
│   │   ├── api_pb2.py
│   │   ├── attr_value.proto
│   │   ├── attr_value_pb2.py
│   │   ├── event.proto
│   │   ├── event_pb2.py
│   │   ├── graph.proto
│   │   ├── graph_pb2.py
│   │   ├── layout.proto
│   │   ├── layout_pb2.py
│   │   ├── node_def.proto
│   │   ├── node_def_pb2.py
│   │   ├── plugin_hparams.proto
│   │   ├── plugin_hparams_pb2.py
│   │   ├── plugin_mesh.proto
│   │   ├── plugin_mesh_pb2.py
│   │   ├── plugin_pr_curve.proto
│   │   ├── plugin_pr_curve_pb2.py
│   │   ├── plugin_text.proto
│   │   ├── plugin_text_pb2.py
│   │   ├── resource_handle.proto
│   │   ├── resource_handle_pb2.py
│   │   ├── summary.proto
│   │   ├── summary_pb2.py
│   │   ├── tensor.proto
│   │   ├── tensor_pb2.py
│   │   ├── tensor_shape.proto
│   │   ├── tensor_shape_pb2.py
│   │   ├── types.proto
│   │   ├── types_pb2.py
│   │   ├── versions.proto
│   │   └── versions_pb2.py
│   ├── record_writer.py
│   ├── summary.py
│   ├── torchvis.py
│   ├── utils.py
│   ├── visdom_writer.py
│   ├── writer.py
│   └── x2num.py
├── test-requirements.txt
└── tests/
    ├── __init__.py
    ├── event_file_writer_test.py
    ├── expect/
    │   ├── caffe_mnist.expect
    │   ├── caffe_overfeat.expect
    │   ├── test_caffe2.test_simple_cnnmodel.expect
    │   ├── test_caffe2.test_simple_model.expect
    │   ├── test_pr_curve.test_pr_purve.expect
    │   ├── test_pr_curve.test_pr_purve_raw.expect
    │   ├── test_summary.test_audio.expect
    │   ├── test_summary.test_custom_scalars.expect
    │   ├── test_summary.test_float32_image.expect
    │   ├── test_summary.test_histogram_auto.expect
    │   ├── test_summary.test_histogram_doane.expect
    │   ├── test_summary.test_histogram_fd.expect
    │   ├── test_summary.test_hparams.expect
    │   ├── test_summary.test_hparams_bool.expect
    │   ├── test_summary.test_hparams_string.expect
    │   ├── test_summary.test_image_with_3_channel_batched.expect
    │   ├── test_summary.test_image_with_boxes.expect
    │   ├── test_summary.test_image_with_four_channel.expect
    │   ├── test_summary.test_image_with_four_channel_batched.expect
    │   ├── test_summary.test_image_with_one_channel.expect
    │   ├── test_summary.test_image_with_one_channel_batched.expect
    │   ├── test_summary.test_image_without_channel.expect
    │   ├── test_summary.test_mesh.expect
    │   ├── test_summary.test_text.expect
    │   ├── test_summary.test_uint8_image.expect
    │   └── test_summary.test_video.expect
    ├── expect_reader.py
    ├── mnist-8.onnx
    ├── record_writer_test.py
    ├── test_chainer_np.py
    ├── test_crc32c.py
    ├── test_embedding.py
    ├── test_figure.py
    ├── test_hparams.py
    ├── test_lint.py
    ├── test_multiprocess_write.py
    ├── test_numpy.py
    ├── test_onnx_graph.py
    ├── test_openvino_graph.py
    ├── test_pr_curve.py
    ├── test_pytorch_graph.py
    ├── test_pytorch_np.py
    ├── test_record_writer.py
    ├── test_summary.py
    ├── test_summary_writer.py
    ├── test_utils.py
    ├── test_visdom.py
    └── test_writer.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .codecov.yml
================================================
codecov:
    bot: lanpa
coverage:
  status:
    project:                   # measuring the overall project coverage
      default:                 # context, you can create multiple ones with custom titles
        enabled: yes 
    patch:
      default:
        enabled: no
comment:
  layout: "diff, flags, files"
  behavior: default
  require_changes: false  # if true: only post the comment if coverage changes
  require_base: no        # [yes :: must have a base report to post]
  require_head: yes       # [yes :: must have a head report to post]
  branches: null


================================================
FILE: .flake8
================================================
[flake8]
max-line-length = 120
ignore = W605,E305,E402,E721,E741,F401,F403,F405,F821,F841,F999
exclude = tensorboardX/proto

================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create bug report
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Minimal runnable code to reproduce the behavior**
```
from tensorboardX import SummaryWriter
...
```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment**
What is the result of 
`pip list|grep -E "torch|proto|tensor"`
If the version is too old, please try to update first.


**Python environment**
Which version of python are you using? Did you use Andconda or Virtualenv?

**Additional context**
Add any other context about the problem here.


================================================
FILE: .github/ISSUE_TEMPLATE/feature-requests-or-general-questions.md
================================================
---
name: Feature requests or General questions
about: Feature requests or general questions
title: ''
labels: ''
assignees: ''

---




================================================
FILE: .github/workflows/build-wheel.yml
================================================
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build and test the python package
on:
  push:
    branches:
      - 'releases/**'
jobs: 
  build:
    name: Build whl from source
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Set up Python 3.9
      uses: actions/setup-python@v3
      with:
        python-version: 3.9

    - name: Fetch git tags from origin
      run: git fetch --tags origin

    - name: Install build and wheel packages
      run: >-
        python -m
        pip install
        build wheel
        --user

    - name: Build wheel and source distribution
      run: |
        echo `pwd`
        echo `git describe --tags`
        python -m build --wheel --sdist

    - name: Archive production artifacts
      uses: actions/upload-artifact@v4
      with:
        name: dist-pip-whl
        path: |
          dist

  test-the-wheel:
    name: Install whl and run demo
    needs: build
    runs-on: ubuntu-latest
    steps:
    - name: Dump GitHub context
      id: github_context_step
      run: echo '${{ toJSON(github) }}'

    - uses: actions/checkout@v3
    - name: Set up Python 3.9
      uses: actions/setup-python@v3
      with:
        python-version: 3.9

    - name: Download build artifacts
      uses: actions/download-artifact@v4.1.7
      with:
        name: dist-pip-whl

    - name: Install tensorboardX from wheel
      run: pip install tensorboardx*.whl

    - name: Install torch torchvision for demo
      run: pip install torch torchvision

    - name: Print version
      run: python -c "import tensorboardX; print(tensorboardX.__version__)"

    - name: Run examples
      run: |
        cd examples
        python demo.py

    - name: Archive demo artifacts
      uses: actions/upload-artifact@v4
      with:
        name: demo-results
        path: |
          examples/runs



================================================
FILE: .github/workflows/publish-pypi.yml
================================================
on:
  workflow_dispatch:
    inputs:
      publish_version:
        required: true
        type: string

jobs:
  log-the-inputs:
    runs-on: ubuntu-latest
    steps:
      - run: |
          echo "target version: ${{ github.event.inputs.publish_version }}"
        env:
          VERSION: ${{ github.event.inputs.publish_version }}

  upload-to-pypi:
    name: Publish to PyPI test site
    runs-on: ubuntu-latest
    steps:
    - name: Dump GitHub context
      id: github_context_step
      run: |
          echo '${{ toJSON(github) }}'
          echo "target version: ${{ github.event.inputs.publish_version }}"

    - uses: actions/checkout@v3
    - name: Set up Python 3.9
      uses: actions/setup-python@v3
      with:
        python-version: 3.9

    - name: Make sure the branch name is "refs/heads/releases/*"
      run: |
        if [[ "${{ github.ref }}" != refs/heads/releases/* ]]; then
          echo "This workflow only runs on branches matching 'releases/*'. Current branch: ${{ github.ref }}"
          exit 1
        fi

    - name: Fetch git tags and create version tag
      run: |
        git fetch --tags origin
        git tag ${{ github.event.inputs.publish_version }}

    - name: Install build and wheel packages
      run: >-
        python -m
        pip install
        build wheel
        --user

    - name: Build wheel and source distribution
      run: |
        echo `pwd`
        python -m build --wheel --sdist

    - name: Install tensorboardX from wheel
      run: pip install dist/tensorboardx*.whl

    - name: Print version
      run: python -c "import tensorboardX; print(tensorboardX.__version__)"

    - name: Check version matches publish_version
      run: |
        VERSION=$(python -c "import tensorboardX; print(tensorboardX.__version__)")
        if [ "$VERSION" != "${{ github.event.inputs.publish_version }}" ]; then
          echo "Version mismatch: $VERSION does not match ${{ github.event.inputs.publish_version }}"
          exit 1
        fi

    - name: Publish to Test PyPI
      uses: pypa/gh-action-pypi-publish@release/v1
      with:
        password: ${{ secrets.PYPI_API_TESTSITE }}
        repository-url: https://test.pypi.org/legacy/
        attestations: false

    - name: Publish to PyPI
      uses: pypa/gh-action-pypi-publish@release/v1
      with:
        password: ${{ secrets.PYPI_API }}
        repository_url: https://upload.pypi.org/legacy/
        attestations: false




================================================
FILE: .github/workflows/test-matrix.yml
================================================
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]


jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12"]
    steps:
    - uses: actions/checkout@v2
    - name: Install system dependencies and setup Python environment
      run: |
        sudo apt-get install libsndfile1
        curl -LsSf https://astral.sh/uv/install.sh | sh
        uv venv --python ${{ matrix.python-version }}
        source .venv/bin/activate
        uv sync
    - name: Lint with ruff
      run: |
        source .venv/bin/activate
        ruff check tensorboardX/
    - name: Test with pytest
      env:
          MPLBACKEND: Agg
          PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
      run: |
        source .venv/bin/activate
        visdom &
        pytest --cov=tensorboardX --cov-report=xml tests/

    - name: Upload coverage to Codecov
      if: ${{ !cancelled() && matrix.python-version == '3.11' }}
      run: |
        curl -Os https://cli.codecov.io/latest/linux/codecov
        chmod +x codecov
        ./codecov --verbose upload-process --fail-on-error -n 'service'-${{ github.run_id }} -F service -f coverage.xml

  test:
    needs: build
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install dependencies and run examples
      run: |
        curl -LsSf https://astral.sh/uv/install.sh | sh
        uv venv --python 3.9
        source .venv/bin/activate
        uv pip install six tensorboard pytest matplotlib torchvision protobuf==4.22.3 moviepy==1.0.3 imageio==2.27
        python examples/demo.py
        python examples/demo_graph.py
        python examples/demo_embedding.py
        python examples/demo_custom_scalars.py
        python examples/demo_multiple_embedding.py
        python examples/demo_purge.py
        python examples/demo_matplotlib.py

  test-protobuf-versions:
    needs: build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        protobuf-version: ["3.20", "4.21", "4.22", "4.23"]
    steps:
    - uses: actions/checkout@v2
    - name: Install python 3.11 and setup environment
      run: |
        curl -LsSf https://astral.sh/uv/install.sh | sh
        uv venv --python 3.11
 
    - name: Run basic import check
      run: |
        source .venv/bin/activate
        uv pip install numpy protobuf==${{ matrix.protobuf-version }}
        python -c "import tensorboardX"
 


================================================
FILE: .gitignore
================================================
proto_src/
protoc-*.zip
protoc/
__pycache__
docs/_*
build
dist
*.egg-info
runs/*
*.pyc
mnist
tensorboardX/_version.py
s3:
.coverage
.vscode
.DS_store
uv.lock


================================================
FILE: .readthedocs.yaml
================================================
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
  os: ubuntu-22.04
  tools:
    python: "3.11"
    # You can also specify other tool versions:
    # nodejs: "20"
    # rust: "1.70"
    # golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
  configuration: docs/conf.py
  # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
  # builder: "dirhtml"
  # Fail on all warnings to avoid broken references
  # fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
#    - pdf
#    - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
  install:
    - requirements: docs/requirements.txt



================================================
FILE: HISTORY.rst
================================================
History
=======
2.6.3 (2025-04-24)
---------------------
* Support PaddlePaddle tensors
* Added a use_metadata context manager
* MoviePy version 2 support

2.6.2.2 (2023-08-20)
---------------------
* Added protobuf's lower bound version (>=3.20)

2.6.2.1 (2023-08-20)
---------------------
* [Yanked because operation miss] Added protobuf's lower bound version (>=3.20)

2.6.2 (2023-07-30)
-------------------
* [Yanked because wrong dependency] Removed version limit for protobuf

2.6.1 (2023-06-18)
-------------------
* Expose use_strict_trace parameter in add_graph (#694)
* Upgrade to protobuf 4
* Fix git based package versioning
* Fix GCS Connection Error #606 (#686)

2.6 (2023-02-12)
-------------------
* Fixed several deprecation warnings
* Update dependencies

2.5.1 (2022-06-05)
-------------------
* Enforce protobuf's version upper bound

2.5 (2022-02-22)
-----------------
* Fix deprecation warnings
* Comet integration improvements (#658)

2.4.1 (2021-11-20)
-------------------
* Fix a comet plugin bug if writer is reused. (#639)

2.4 (2021-06-30)
-----------------
* Remove a dependency issue. (#631)

2.3 (2021-06-20)
-----------------
* Support logging to comet.ml simutaneously.

2.2 (2021-04-03)
-----------------
* Support for type hints.
* Dropped Python 2 support.
* Bug fixes, see the commit log in Github.

2.1 (2020-07-05)
-----------------
* Global SummaryWriter that mimics python's default logger class, concurrent write is supported.
* 200x speed up for add_audio. Please install the soundfile package for this feature.
* Supports jax tensors.
* The add_graph function is delegated to the one in torch.utils.tensorboard.
* Bug fixes, see the commit log in Github.

2.0 (2019-12-31)
-----------------
* Now you can tag Hparams trials with custom name instead of the default epoch time
* Fixed a bug that add_hparams are rendered incorrectly with non-string values
* Supports logging to Amazon S3 or Google Cloud Storage
* Bug fixes and error message for add_embedding function
* Draw openvino format with add_openvino_graph

1.9 (2019-10-04)
-----------------
* Use new JIT backend for pytorch. This works better with pytorch 1.2 and 1.3
* Supports hparams plugin
* add_embedding now supports numpy array input

1.8 (2019-07-05)
-----------------
* Draw label text on image with bounding box provided.
* crc32c speed up (optional by installing crc32c manually)
* Rewrite add_graph. onnx backend is replaced by JIT to support more advanced structure.
* Now you can add_mesh() to visualize colorful point cloud or meshes.

1.7 (2019-05-19)
-----------------
* Able to write to S3
* Fixed raw histogram issue that nothing is shown in TensorBoard
* Users can use various image/video dimension permutation by passing 'dataformats' parameter.
* You can bybass the writer by passing write_to_disk=True to SummaryWriter


1.6 (2019-01-02)
-----------------
* Many graph related bug is fixed in this version.
* New function: add_images(). This function accepts 4D iamge tensor. See documentation.
* Make add_image_with_boxes() usable.
* API change: add_video now accepts BxTxCxHxW instead of BxCxTxHxW tensor.

1.5 (2018-12-10)
-----------------
* Add API for Custom scalar
* Add support for logging directly to S3
* Add support for Caffe2 graph
* Pytorch 1.0.0 JIT graph support (alpha-release)

1.4 (2018-08-09)
-----------------
* Made add_text compatible with tensorboard>1.6
* Fix the issue of strange histogram if default binning method is used
* Supports passing matplotlib figures to add_image()
* Resolve namespace confliction with TF tensorboard
* add_image_boxes function
* Supports custom timestamp for event

1.2 (2018-04-21)
-----------------
* Supports tensorshape information in graph visualization. Drop support for 0.3.1
* Adds add_video function

1.1 (2018-02-21)
-----------------
* Supports pytorch 0.3.1 (hacky)

1.0 (2018-01-18)
-----------------
* Supports graph (the pretty one)

0.9 (2017-11-11)
-----------------
* Supports markdown for add_text function
* It's ready to log precision recall curve (needs tensorboard>=0.4)
* Adds context manager for the SummaryWriter class

0.8 (2017-09-25)
-----------------
* Package name renamed to tensorboardX to fix namespace confliction with tensorflow's tensorboard
* Supports multi-scalars and JSON export
* Multiple Embeddings in One Experiment 
* Supports Chainer and mxnet

0.7 (2017-08-22)
-----------------
* remove tensorflow dependency for embedding function
* fixed incorrect image<->label pairing in embedding function (#12)
* unifies API call and adds docstring. Documentation is available at: http://tensorboard-pytorch.readthedocs.io/

0.6.5 (2017-07-30)
------------------
* add travis test (py2.7, py3.6)
* add support for python2 (in PyPI)

0.6 (2017-07-18)
-----------------
* supports embedding

0.5 (2017-07-18)
-----------------
* supports graph summary
* fixed np.histogram issue

0.4 (2017-07-12)
-----------------
* supports text summary

0.3 (2017-07-03)
-----------------
* supports audio summary

0.2 (2017-06-24)
-----------------
* simplifies add_image API
* speed up add_histogram API by 35x


0.1 (2017-06-13)
------------------
* First commit. Reference:

https://github.com/TeamHG-Memex/tensorboard_logger
https://github.com/dmlc/tensorboard


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2025 Tzu-Wei Huang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: MANIFEST.in
================================================
include HISTORY.rst
include LICENSE
include compile.sh
recursive-include tensorboardX/proto *
recursive-exclude test *
recursive-exclude examples *
recursive-include tensorboardX/beholder *
global-exclude *.pyc

================================================
FILE: README.md
================================================
# tensorboardX

[![PyPI version](https://badge.fury.io/py/tensorboardX.svg)](https://badge.fury.io/py/tensorboardX)
[![Documentation Status](https://readthedocs.org/projects/tensorboardx/badge/?version=latest)](https://tensorboardx.readthedocs.io/en/latest/?badge=latest)
[![Coverage Status](https://codecov.io/gh/lanpa/tensorboardX/branch/master/graph/badge.svg)](https://codecov.io/gh/lanpa/tensorboardX/)

Write TensorBoard events with simple function call.

The current release (v2.6.3) is tested with PyTorch 2.6 / torchvision 0.21.0 / tensorboard 2.19.0 on Python 3.9 to 3.12

* Support `scalar`, `image`, `figure`, `histogram`, `audio`, `text`, `graph`, `onnx_graph`, `embedding`, `pr_curve`, `mesh`, `hyper-parameters`
  and `video` summaries.

* [FAQ](https://github.com/lanpa/tensorboardX/wiki)


## Install

`pip install tensorboardX`

or build from source:

`pip install 'git+https://github.com/lanpa/tensorboardX'`

You can optionally install [`crc32c`](https://github.com/ICRAR/crc32c) to speed up.

`pip install crc32c`

Starting from tensorboardX 2.1, You need to install `soundfile` for the `add_audio()` function (200x speedup).

`pip install soundfile`

## Example

* Clone the files in https://github.com/lanpa/tensorboardX/tree/master/examples
* Run the demo script: e.g. `python examples/demo.py`
* Start TensorBoard with `tensorboard --logdir runs`  


```python
# demo.py

import torch
import torchvision.utils as vutils
import numpy as np
import torchvision.models as models
from torchvision import datasets
from tensorboardX import SummaryWriter

resnet18 = models.resnet18(False)
writer = SummaryWriter()
sample_rate = 44100
freqs = [262, 294, 330, 349, 392, 440, 440, 440, 440, 440, 440]

for n_iter in range(100):

    dummy_s1 = torch.rand(1)
    dummy_s2 = torch.rand(1)
    # data grouping by `slash`
    writer.add_scalar('data/scalar1', dummy_s1[0], n_iter)
    writer.add_scalar('data/scalar2', dummy_s2[0], n_iter)

    writer.add_scalars('data/scalar_group', {'xsinx': n_iter * np.sin(n_iter),
                                             'xcosx': n_iter * np.cos(n_iter),
                                             'arctanx': np.arctan(n_iter)}, n_iter)

    dummy_img = torch.rand(32, 3, 64, 64)  # output from network
    if n_iter % 10 == 0:
        x = vutils.make_grid(dummy_img, normalize=True, scale_each=True)
        writer.add_image('Image', x, n_iter)

        dummy_audio = torch.zeros(sample_rate * 2)
        for i in range(x.size(0)):
            # amplitude of sound should in [-1, 1]
            dummy_audio[i] = np.cos(freqs[n_iter // 10] * np.pi * float(i) / float(sample_rate))
        writer.add_audio('myAudio', dummy_audio, n_iter, sample_rate=sample_rate)

        writer.add_text('Text', 'text logged at step:' + str(n_iter), n_iter)

        for name, param in resnet18.named_parameters():
            writer.add_histogram(name, param.clone().cpu().data.numpy(), n_iter)

        # needs tensorboard 0.4RC or later
        writer.add_pr_curve('xoxo', np.random.randint(2, size=100), np.random.rand(100), n_iter)

dataset = datasets.MNIST('mnist', train=False, download=True)
images = dataset.test_data[:100].float()
label = dataset.test_labels[:100]

features = images.view(100, 784)
writer.add_embedding(features, metadata=label, label_img=images.unsqueeze(1))

# export scalar data to JSON for external processing
writer.export_scalars_to_json("./all_scalars.json")
writer.close()
```

## Screenshots

<img src="screenshots/Demo.gif">

## Using TensorboardX with Comet

TensorboardX now supports logging directly to [Comet](https://www.comet.com/site/products/ml-experiment-tracking/?utm_source=tensorboardx&utm_medium=partner&utm_campaign=partner_tensorboardx_2023). Comet is a **free** cloud based solution that allows you to automatically track, compare and explain your experiments. It adds a lot of functionality on top of tensorboard such as dataset management, diffing experiments, seeing the code that generated the results and more.

This works out of the box and just require an additional line of code. See a full code example in this [Colab Notebook](https://colab.research.google.com/drive/1cTO3tgZ03nuJQ8kOjZhEiwbB-45tV4lm?usp=sharing)

<p align="center">
<img src="screenshots/comet.gif" width="750" height="400">
</p>

## Tweaks

To add more ticks for the slider (show more image history), check https://github.com/lanpa/tensorboardX/issues/44 or 
https://github.com/tensorflow/tensorboard/pull/1138

## Reference

* [TeamHG-Memex/tensorboard_logger](https://github.com/TeamHG-Memex/tensorboard_logger)
* [dmlc/tensorboard](https://github.com/dmlc/tensorboard)


================================================
FILE: compile.sh
================================================
#!/bin/bash

# Exit on error
# set -e

DESIRED_PROTO_VERSION="22.3"

# call protoc direclty, if version is not the desired one, download the desired vesrion.


if [ -f "protoc/bin/protoc" ]; then
  PROTOC_BIN="protoc/bin/protoc"
else
  PROTOC_BIN=`which protoc`
fi

echo "using" $PROTOC_BIN

CURRENT_PROTOC_VER=`${PROTOC_BIN} --version`
if [ -z ${PROTOC_BIN} ] || [[ "$CURRENT_PROTOC_VER" != "libprotoc "$DESIRED_PROTO_VERSION ]]; then
  # Download and use the latest version of protoc.
  if [ "$(uname)" == "Darwin" ]; then
    PROTOC_ZIP="protoc-"$DESIRED_PROTO_VERSION"-osx-x86_64.zip"
  else
    PROTOC_ZIP="protoc-"$DESIRED_PROTO_VERSION"-linux-x86_64.zip"
  fi
  WGET_BIN=`which wget`
  if [[ ! -z ${WGET_BIN} ]]; then
    ${WGET_BIN} https://github.com/protocolbuffers/protobuf/releases/download/v"$DESIRED_PROTO_VERSION"/${PROTOC_ZIP}
    rm -rf protoc
    python -c "import zipfile; zipfile.ZipFile('"${PROTOC_ZIP}"','r').extractall('protoc')"
    PROTOC_BIN=protoc/bin/protoc
    chmod +x ${PROTOC_BIN}
  fi
fi

# Regenerate
if [[ ! -z ${PROTOC_BIN} ]]; then
  # Delete all existing Python protobuf (*_pb2.py) output
  rm -rf tensorboardX/proto/*pb2*.py
  ${PROTOC_BIN} tensorboardX/proto/*.proto --python_out=.

  echo "Done generating tensorboardX/proto/*pb2*.py"
else
  echo "protoc not installed so can't regenerate tensorboardX/proto/*pb2*.py, using precompiled version."
fi



================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
SPHINXPROJ    = tensorboardX
SOURCEDIR     = .
BUILDDIR      = _build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

================================================
FILE: docs/conf.py
================================================
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# tensorboardX documentation build configuration file, created by
# sphinx-quickstart on Wed Aug  9 01:38:01 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
# sys.path.insert(0, os.path.abspath('.'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
#import tensorboard #uncomment to shadow pip installation
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
    'sphinx.ext.mathjax',
    'sphinx.ext.intersphinx',
    'sphinx.ext.napoleon',
    'sphinx.ext.viewcode',
    'sphinx.ext.githubpages']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'tensorboardX'
copyright = '2017, tensorboardX Contributors'
author = 'tensorboardX Contributors'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
release = ''

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'tensorboardXdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    # 'papersize': 'letterpaper',

    # The font size ('10pt', '11pt' or '12pt').
    #
    # 'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    #
    # 'preamble': '',

    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
    (master_doc, 'tensorboardX.tex', 'tensorboardX Documentation',
     'tensorboardX Contributors', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    (master_doc, 'tensorboardX', 'tensorboardX Documentation',
     [author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    (master_doc, 'tensorboardX', 'tensorboardX Documentation',
     author, 'tensorboardX', 'One line description of project.',
     'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
    'python':('https://docs.python.org/3', None),
    'numpy': ('http://docs.scipy.org/doc/numpy/', None),
    'torch': ('http://pytorch.org/docs/master', None),
    'matplotlib': ('http://matplotlib.sourceforge.net/', None),
    }


================================================
FILE: docs/index.rst
================================================
.. tensorboardX documentation master file, created by
   sphinx-quickstart on Wed Aug  9 01:38:01 2017.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to tensorboardX's documentation!
===============================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   tensorboard
   utils
   tutorial
   tutorial_zh

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


================================================
FILE: docs/requirements.txt
================================================
sphinx-rtd-theme



================================================
FILE: docs/tensorboard.rst
================================================
tensorboardX
===================================
.. automodule:: tensorboardX

.. autoclass:: SummaryWriter
    :members:
    
    .. automethod:: __init__

.. autoclass:: GlobalSummaryWriter
    :members:
    
    .. automethod:: __init__

.. autoclass:: TorchVis
    :members:

    .. automethod:: __init__

================================================
FILE: docs/tutorial.rst
================================================
Tutorials
*********

What is tensorboard X?
----------------------

At first, the package was named tensorboard, and soon there are issues about
name confliction. The first alternative name came to my mind is
tensorboard-pytorch, but in order to make it more general, I chose tensorboardX
which stands for tensorboard for X.

Google's tensorflow's tensorboard is a web server to serve visualizations of the
training progress of a neural network, it visualizes scalar values, images,
text, etc.; these information are saved as events in tensorflow. It's a pity
that other deep learning frameworks lack of such tool, so there are already
packages letting users to log the events without tensorflow; however they only
provides basic functionalities. The purpose of this package is to let
researchers use a simple interface to log events within PyTorch (and then show
visualization in tensorboard). This package currently supports logging scalar,
image, audio, histogram, text, embedding, and the route of back-propagation. The
following manual is tested on Ubuntu and Mac, and the environment are anaconda's
python2 and python3.


Create a summary writer
-----------------------
Before logging anything, we need to create a writer instance. This can be done with:

.. code-block:: python

    from tensorboardX import SummaryWriter
    #SummaryWriter encapsulates everything
    writer = SummaryWriter('runs/exp-1')
    #creates writer object. The log will be saved in 'runs/exp-1'
    writer2 = SummaryWriter()
    #creates writer2 object with auto generated file name, the dir will be something like 'runs/Aug20-17-20-33'
    writer3 = SummaryWriter(comment='3x learning rate')
    #creates writer3 object with auto generated file name, the comment will be appended to the filename. The dir will be something like 'runs/Aug20-17-20-33-3xlearning rate'

Each subfolder will be treated as different experiments in tensorboard. Each
time you re-run the experiment with different settings, you should change the
name of the sub folder such as ``runs/exp2``, ``runs/myexp`` so that you can
easily compare different experiment settings. Type ``tensorboard runs`` to compare
different runs in tensorboard.


General api format
------------------
.. code-block:: python

    add_something(tag name, object, iteration number)


Add scalar
-----------
Scalar value is the most simple data type to deal with. Mostly we save the loss
value of each training step, or the accuracy after each epoch. Sometimes I save
the corresponding learning rate as well. It's cheap to save scalar value. Just
log anything you think is important. To log a scalar value, use
``writer.add_scalar('myscalar', value, iteration)``. Note that the program complains
if you feed a PyTorch tensor. Remember to extract the scalar value by
``x.item()`` if ``x`` is a torch scalar tensor.


Add image
---------
An image is represented as 3-dimensional tensor. The simplest case is save one
image at a time. In this case, the image should be passed as a 3-dimension
tensor of size ``[3, H, W]``. The three dimensions correspond to R, G, B channel of
an image. After your image is computed, use ``writer.add_image('imresult', x,
iteration)`` to save the image. If you have a batch of images to show, use
``torchvision``'s ``make_grid`` function to prepare the image array and send the result
to ``add_image(...)`` (``make_grid`` takes a 4D tensor and returns tiled images in 3D tensor).

.. Note::
	Remember to normalize your image.


Add histogram
-------------
Saving histograms is expensive. Both in computation time and storage. If training
slows down after using this package, check this first. To save a histogram,
convert the array into numpy array and save with ``writer.add_histogram('hist',
array, iteration)``.


Add figure
----------
You can save a matplotlib figure to tensorboard with the add_figure function. ``figure`` input should be ``matplotlib.pyplot.figure`` or a list of ``matplotlib.pyplot.figure``.
Check `<https://tensorboardx.readthedocs.io/en/latest/tensorboard.html#tensorboardX.SummaryWriter.add_figure>`_ for the detailed usage.

Add graph
---------
To visualize a model, you need a model ``m`` and the input ``t``. ``t`` can be a tensor or a list of tensors
depending on your model. If error happens, make sure that ``m(t)`` runs without problem first. See
`The graph demo <https://github.com/lanpa/tensorboardX/blob/master/examples/demo_graph.py>`_ for
complete example.


Add audio
---------
To log a single channel audio, use ``add_audio(tag, audio, iteration, sample_rate)``, where ``audio`` is an one dimensional array, and each element in the array represents the consecutive amplitude samples.
For a 2 seconds audio with ``sample_rate`` 44100 Hz, the input ``x`` should have 88200 elements.
Each element should lie in [−1, 1].

Add embedding
-------------
Embeddings, high dimensional data, can be visualized and converted
into human perceptible 3D data by tensorboard, which provides PCA and
t-sne to project the data into low dimensional space. What you need to do is
provide a bunch of points and tensorboard will do the rest for you. The bunch of
points is passed as a tensor of size ``n x d``, where ``n`` is the number of points and
``d`` is the feature dimension. The feature representation can either be raw data
(*e.g.* the MNIST image) or a representation learned by your network (extracted
feature). This determines how the points distributes. To make the visualization
more informative, you can pass optional metadata or ``label_imgs`` for each data
points. In this way you can see that neighboring point have similar label and
distant points have very different label (semantically or visually). Here the
metadata is a list of labels, and the length of the list should equal to ``n``, the
number of the points. The ``label_imgs`` is a 4D tensor of size ``NCHW``. ``N`` should equal
to ``n`` as well. See
`The embedding demo <https://github.com/lanpa/tensorboardX/blob/master/examples/demo_embedding.py>`_ for
complete example.


Useful commands
---------------
Install
=======

Simply type ``pip install tensorboardX`` in a unix shell to install this package.
To use the newest version, you might need to build from source or ``pip install
tensorboardX —-no-cache-dir`` .  To run tensorboard web server, you need
to install it using ``pip install tensorboard``.
After that, type ``tensorboard --logdir=<your_log_dir>`` to start the server, where
``your_log_dir`` is the parameter of the object constructor. I think this command is
tedious, so I add a line alias ``tb='tensorboard --logdir '`` in ``~/.bashrc``. In
this way, the above command is simplified as ``tb <your_log_dir>``. Use your favorite
browser to load the tensorboard page, the address will be shown in the terminal
after starting the server.


Misc
----
Performance issue
=================
Logging is cheap, but display is expensive.
For my experience, if there are 3 or more experiments to show at a time and each
experiment have, say, 50k points, tensorboard might need a lot of time to
present the data.


Grouping plots
==============
Usually, there are many numbers to log in one experiment. For example, when
training GANs you should log the loss of the generator, discriminator. If the
loss is composed of two other loss functions, say L1 and MSE, you might want to
log the value of the other two losses as well. In this case, you can write the
tags as Gen/L1, Gen/MSE, Desc/L1, Desc/MSE. In this way, tensorboard will group
the plots into two sections (Gen, Desc). You can also use the regular expression
to filter data.


================================================
FILE: docs/tutorial_zh.rst
================================================
Tutorials_zh
*************

緣起
------
Google TensorFlow 附加的工具 Tensorboard 是一個很好用的視覺化工具。他可以記錄數字,影像或者是聲音資訊,對於觀察類神經網路訓練的過程非常有幫助。很可惜的是其他的訓練框架(PyTorch, Chainer, numpy)並沒有這麼好用的工具。網路上稍加搜尋可以發現已經有一些現成的套件可以讓不同的訓練框架使用 web 介面來觀察訓練情形,不過他們可以記錄的東西比較有限或是使用起來比較複雜 (tensorboard_logger, visdom)。tensorboardX 的目的就是讓其他 tensorboard 的功能都可以輕易的被非 TensorFlow 的框架使用。
目前這個套件除了 tensorboard beholder 之外支援所有 tensorboard 的紀錄型態。這個套件目前的標準測試環境為 Ubuntu 或是 Mac ,windows 則是有不定期手動測試;使用的 python 版本為 anaconda 的 python3。

安裝
-------
在命令列輸入 ``pip install tensorboardX`` 即可
或是最新版源碼安裝 ``pip install tensorboardX``

使用
-------
建立 event writer 實體
在紀錄任何東西之前,我們需要建立一個 event writer 實體。
from tensorboardX import SummaryWriter 
#SummaryWriter 是一個類別,包含這套件的所有功能。

``writer = SummaryWriter('runs/exp-1')``
#建立實體。資料存放在:``'runs/exp-1'``
#接下來要寫入任何資料都是呼叫 ``writer.add_某功能()``

``writer = SummaryWriter()``
#使用預設名稱建立實體。資料存放在:``'runs/現在時間-機器名字'`` ex. ``'runs/Aug20-obov01'``

``writer = SummaryWriter(comment='3xLR')``
#在預設資料夾後面加上註解 檔名變為:``'runs/Aug20-obov01-3xLR'``
上面的程式碼會在目前的工作目錄下建立一個叫 ``runs`` 的資料夾以及子目錄 ``exp1``。 每個子目錄都會被視為一個實驗。每次執行新的實驗時,比如說改了一些參數,這時請將資料夾重新命名,像是: ``runs/exp2``, ``runs/myexp`` 這樣可以便於比較實驗的結果。 建議:資料夾可以用時間命名或者是直接把參數當成資料夾的名稱。
建立 writer 實體之後就可以開始紀錄資料了
API 的長相大概是:``add_xxx(標籤,要記錄的東西,時間戳,其他參數)``

紀錄純量
-------------
純量是最好記錄的東西。通常我們會把每次訓練的損失記錄下來或者是測試的準確度都是值得記錄的東西。其他數據,像是學習率也值得紀錄。
紀錄純量的方法是 ``writer.add_scalar('myscalar', value, iteration)``
value 可以是 PyTorch tensor , numpy或是 float,int 之類的python原生數字類別。

記錄影像
-------------
影像使用一個三維的矩陣來表示。這三個維度分別代表紅色,綠色,藍色的強度。一張寬200, 高100的影像其對應的矩陣大小為[3, 100, 200] (CHW)。最簡單情況是只有一張影像要存。這時候只需要注意一下是不是符合上述的規格然後將它傳到: ``writer.add_image('imresult', image, iteration)`` 即可。 
通常訓練的時候會採用批次處理,所以有一大堆影像要存。這時候請確定你的資料維度是 ``(NCHW)``, 其中 ``N`` 是batchsize。``add_image`` 會自動將他排列成適當大小。要注意的是,如果要記錄的影像是 OpenCV/numpy 格式,他們通常呈現 ``(HWC)`` 的排列,這時候要呼叫 ``numpy.transpose`` 將其轉為正確的維度,否則會報錯。另外就是注意影像的值的範圍要介於 [0, 1] 之間。 

紀錄直方圖(histogram)
-------------------------------
記錄直方圖很耗 CPU 資源,不要常用。如果你用了這個套件之後覺得速度變慢了請先檢查一下是不是這個原因。使用方法很簡單,呼叫 ``writer.add_histogram('hist', array, iteration)`` 即可紀錄。

紀錄聲音
-------------
``writer.add_audio('myaudio', audio, iteration, sample_rate)``
這功能只支援單聲道。 add_audio 要傳入的聲音資訊是個一維陣列,陣列的每一個元素代表在每一個取樣點的振幅大小。取樣頻率(sample_rate)為 44100 kHz 的情況下。一段2秒鐘的聲音應該要有88200個點;注意其中每個元素的值應該都介於正負1之間。

紀錄文字
-------------
``writer.add_text('mytext', 'this is a pen', iteration)``
除了一般字串之外,也支援簡單的 markdown 表格。

記錄網路架構。
--------------------------
(實驗性的功能,模型複雜的時候不確定對不對)
問題很多的功能。使用上比較複雜。需要準備兩個東西:網路模型 以及 你要餵給他的 tensor 
舉例來說,令模型為 m,輸入為 x,則使用方法為:
``add_graph(m, (x, ))`` 這裡使用 tuple 的原因是當網路有多個輸入時,可以把他擴充成
``add_graph(m, (x, y, z))`` ,如果只有單一輸入,寫成 ``add_graph(m, x)`` 也無妨。 
常會出錯的原因: 
- 較新的 operator pytorch本身不支援JIT
- 輸入是 cpu tensor,model 在 GPU 上。(或是反過來)
- 輸入的 tensor 大小錯誤,跑到後面幾層維度消失了
- model 寫錯,前後兩層 feature dimension 對不上
除錯方法

forward propagate 一次 ``m(x)`` 或是多個輸入時:``m((x, y, z))``
2. 用 ``torch.onnx.export`` 導出模型,觀察錯誤訊息。

高維度資料視覺化/降維 (embedding)
---------------------------------------------------
因為人類對物體的了解程度只有三維,所以當資料的維度超過三的時候我們沒辦法將他視覺化。這時候就需要降維來讓資料的維度小於等於三。降維運算由 tensorboard 以 Javascript 執行,演算法有 PCA 及 t-sne 兩種可選。這邊我們只需要負責提供每個點的高維度特徵即可。提供的格式是一個矩陣,一個 ``n x d`` 的矩陣 ``n`` 點的數量, ``d`` 是維度的多寡。 高維度特徵可以是原始資料。比如說影像,或是網路學到的壓縮結果。這原始資料決定了資料的分佈情形。如果要看得更清楚一點,你可以再傳 metadata / label_imgs 的參數進去(metadata是一個 python list 長度為 ``n``, ``label_imgs`` 是一個 4 維矩陣,大小是 ``nCHW``。這樣每個點就會有他對應的文字或圖在旁邊。不懂的話就看範例吧:https://github.com/lanpa/tensorboardX/blob/master/examples/demo_embedding.py

紀錄短片
---------------
類似於紀錄影像,不過傳入的物件維度是 ``[B, C, T ,H, W]``,其中 ``T`` 是影格的數量。所以一個 30 frame 的彩色影片 維度是 ``[B, 3, 30 ,H, W]``。

紀錄 pr curve
-------------------
根據預測的機率值以及其對應的標準答案計算 precision-recall 的結果並保存。
``add_pr_curve (tag, labels, predictions, step)``
labels是標準答案,predictions是程式對樣本的預測。 
假設有十筆資料 labels就會長得像 ``[0, 0, 1, 0, 0, 1, 0, 1, 0, 1]``,predictions則長的像 ``[0.1, 0.3, 0.8, 0.2, 0.4, 0.5, 0.1, 0.7, 0.9, 0.2]``。

pyplot 的圖表
------------------------------

用 matplotlib 畫了美美的圖表想紀錄?請用 ``add_figure`` 。傳入的物件是 matplotlib 的 figure。 
顯示結果 
Tensorboard 本質是個網頁伺服器,他讀取的資料來自於訓練網路的時候程式 (tensorboardX) 寫下的事件檔。因為 tensorboard 包含於 tensorflow,所以你需要另外安裝一份 tensorflow 在伺服器主機。我想大部分人都已經裝過了。沒裝過的話就在 unix shell 介面輸入 ``pip install tensorboard``。如果沒有使用 TensorFlow 訓練的需求,建議裝非 GPU 版本,啟動速度快得多。
接下來在命令列輸入 ``tensorboard --logdir=<your_log_dir>`` (以前面的例子來說:``tensorboard --logdir=runs``)伺服器就會啟動了。這個指令打起來很麻煩,所以我都在 ``~/.bashrc`` 加一行:``alias tb='tensorboard --logdir '`` 如此一來指令就簡化成 ``tb <your_log_dir>``。接下來就是照著終端機上的指示打開你的瀏覽器就可以看到畫面了。


================================================
FILE: docs/utils.rst
================================================
Helper functions
===================================
.. autofunction:: tensorboardX.utils.figure_to_image

================================================
FILE: examples/RUN_AFTER_PIP_INSTALL
================================================


================================================
FILE: examples/__init__.py
================================================


================================================
FILE: examples/chainer/extension_logger/net.py
================================================
#!/usr/bin/env python

from __future__ import print_function

import numpy

import chainer
from chainer import cuda
import chainer.functions as F
import chainer.links as L


def add_noise(h, sigma=0.2):
    xp = cuda.get_array_module(h.data)
    if chainer.config.train:
        return h + sigma * xp.random.randn(*h.shape)
    else:
        return h


class Generator(chainer.Chain):

    def __init__(self, n_hidden, bottom_width=4, ch=512, wscale=0.02):
        super(Generator, self).__init__()
        self.n_hidden = n_hidden
        self.ch = ch
        self.bottom_width = bottom_width

        with self.init_scope():
            w = chainer.initializers.Normal(wscale)
            self.l0 = L.Linear(self.n_hidden, bottom_width * bottom_width * ch,
                               initialW=w)
            self.dc1 = L.Deconvolution2D(ch, ch // 2, 4, 2, 1, initialW=w)
            self.dc2 = L.Deconvolution2D(ch // 2, ch // 4, 4, 2, 1, initialW=w)
            self.dc3 = L.Deconvolution2D(ch // 4, ch // 8, 4, 2, 1, initialW=w)
            self.dc4 = L.Deconvolution2D(ch // 8, 3, 3, 1, 1, initialW=w)
            self.bn0 = L.BatchNormalization(bottom_width * bottom_width * ch)
            self.bn1 = L.BatchNormalization(ch // 2)
            self.bn2 = L.BatchNormalization(ch // 4)
            self.bn3 = L.BatchNormalization(ch // 8)

    def make_hidden(self, batchsize):
        return numpy.random.uniform(-1, 1, (batchsize, self.n_hidden, 1, 1))\
            .astype(numpy.float32)

    def __call__(self, z):
        h = F.reshape(F.relu(self.bn0(self.l0(z))),
                      (len(z), self.ch, self.bottom_width, self.bottom_width))
        h = F.relu(self.bn1(self.dc1(h)))
        h = F.relu(self.bn2(self.dc2(h)))
        h = F.relu(self.bn3(self.dc3(h)))
        x = F.sigmoid(self.dc4(h))
        return x


class Discriminator(chainer.Chain):

    def __init__(self, bottom_width=4, ch=512, wscale=0.02):
        w = chainer.initializers.Normal(wscale)
        super(Discriminator, self).__init__()
        with self.init_scope():
            self.c0_0 = L.Convolution2D(3, ch // 8, 3, 1, 1, initialW=w)
            self.c0_1 = L.Convolution2D(ch // 8, ch // 4, 4, 2, 1, initialW=w)
            self.c1_0 = L.Convolution2D(ch // 4, ch // 4, 3, 1, 1, initialW=w)
            self.c1_1 = L.Convolution2D(ch // 4, ch // 2, 4, 2, 1, initialW=w)
            self.c2_0 = L.Convolution2D(ch // 2, ch // 2, 3, 1, 1, initialW=w)
            self.c2_1 = L.Convolution2D(ch // 2, ch // 1, 4, 2, 1, initialW=w)
            self.c3_0 = L.Convolution2D(ch // 1, ch // 1, 3, 1, 1, initialW=w)
            self.l4 = L.Linear(bottom_width * bottom_width * ch, 1, initialW=w)
            self.bn0_1 = L.BatchNormalization(ch // 4, use_gamma=False)
            self.bn1_0 = L.BatchNormalization(ch // 4, use_gamma=False)
            self.bn1_1 = L.BatchNormalization(ch // 2, use_gamma=False)
            self.bn2_0 = L.BatchNormalization(ch // 2, use_gamma=False)
            self.bn2_1 = L.BatchNormalization(ch // 1, use_gamma=False)
            self.bn3_0 = L.BatchNormalization(ch // 1, use_gamma=False)

    def __call__(self, x):
        h = add_noise(x)
        h = F.leaky_relu(add_noise(self.c0_0(h)))
        h = F.leaky_relu(add_noise(self.bn0_1(self.c0_1(h))))
        h = F.leaky_relu(add_noise(self.bn1_0(self.c1_0(h))))
        h = F.leaky_relu(add_noise(self.bn1_1(self.c1_1(h))))
        h = F.leaky_relu(add_noise(self.bn2_0(self.c2_0(h))))
        h = F.leaky_relu(add_noise(self.bn2_1(self.c2_1(h))))
        h = F.leaky_relu(add_noise(self.bn3_0(self.c3_0(h))))
        return self.l4(h)


================================================
FILE: examples/chainer/extension_logger/train_dcgan.py
================================================
#!/usr/bin/env python

from __future__ import print_function
import argparse
import os

import chainer
from chainer import training
from chainer.training import extensions

from net import Discriminator
from net import Generator
from updater import DCGANUpdater
from visualize import out_generated_image
from tensorboardX import SummaryWriter
from writetensorboard import LogTensorboard


def main():
    parser = argparse.ArgumentParser(description='Chainer example: DCGAN')
    parser.add_argument('--batchsize', '-b', type=int, default=50,
                        help='Number of images in each mini-batch')
    parser.add_argument('--epoch', '-e', type=int, default=1000,
                        help='Number of sweeps over the dataset to train')
    parser.add_argument('--gpu', '-g', type=int, default=-1,
                        help='GPU ID (negative value indicates CPU)')
    parser.add_argument('--dataset', '-i', default='',
                        help='Directory of image files.  Default is cifar-10.')
    parser.add_argument('--out', '-o', default='result',
                        help='Directory to output the result')
    parser.add_argument('--resume', '-r', default='',
                        help='Resume the training from snapshot')
    parser.add_argument('--n_hidden', '-n', type=int, default=100,
                        help='Number of hidden units (z)')
    parser.add_argument('--seed', type=int, default=0,
                        help='Random seed of z at visualization stage')
    parser.add_argument('--snapshot_interval', type=int, default=1000,
                        help='Interval of snapshot')
    parser.add_argument('--display_interval', type=int, default=100,
                        help='Interval of displaying log to console')
    args = parser.parse_args()

    print('GPU: {}'.format(args.gpu))
    print('# Minibatch-size: {}'.format(args.batchsize))
    print('# n_hidden: {}'.format(args.n_hidden))
    print('# epoch: {}'.format(args.epoch))
    print('')
    writer = SummaryWriter()
    # Set up a neural network to train
    gen = Generator(n_hidden=args.n_hidden)
    dis = Discriminator()

    if args.gpu >= 0:
        # Make a specified GPU current
        chainer.cuda.get_device_from_id(args.gpu).use()
        gen.to_gpu()  # Copy the model to the GPU
        dis.to_gpu()

    # Setup an optimizer
    def make_optimizer(model, alpha=0.0002, beta1=0.5):
        optimizer = chainer.optimizers.Adam(alpha=alpha, beta1=beta1)
        optimizer.setup(model)
        optimizer.add_hook(chainer.optimizer.WeightDecay(0.0001), 'hook_dec')
        return optimizer
    opt_gen = make_optimizer(gen)
    opt_dis = make_optimizer(dis)

    if args.dataset == '':
        # Load the CIFAR10 dataset if args.dataset is not specified
        train, _ = chainer.datasets.get_cifar10(withlabel=False, scale=255.)
    else:
        all_files = os.listdir(args.dataset)
        image_files = [f for f in all_files if ('png' in f or 'jpg' in f)]
        print('{} contains {} image files'
              .format(args.dataset, len(image_files)))
        train = chainer.datasets\
            .ImageDataset(paths=image_files, root=args.dataset)

    train_iter = chainer.iterators.SerialIterator(train, args.batchsize)

    # Set up a trainer
    updater = DCGANUpdater(
        models=(gen, dis),
        iterator=train_iter,
        optimizer={
            'gen': opt_gen, 'dis': opt_dis},
        device=args.gpu)
    trainer = training.Trainer(updater, (args.epoch, 'epoch'), out=args.out)

    snapshot_interval = (args.snapshot_interval, 'iteration')
    display_interval = (args.display_interval, 'iteration')
    trainer.extend(
        extensions.snapshot(filename='snapshot_iter_{.updater.iteration}.npz'),
        trigger=snapshot_interval)
    trainer.extend(extensions.snapshot_object(
        gen, 'gen_iter_{.updater.iteration}.npz'), trigger=snapshot_interval)
    trainer.extend(extensions.snapshot_object(
        dis, 'dis_iter_{.updater.iteration}.npz'), trigger=snapshot_interval)
    trainer.extend(extensions.LogReport(trigger=display_interval))
    trainer.extend(LogTensorboard(trigger=display_interval, logger=writer))
    trainer.extend(extensions.PrintReport([
        'epoch', 'iteration', 'gen/loss', 'dis/loss',
    ]), trigger=display_interval)
    trainer.extend(extensions.ProgressBar(update_interval=10))
    trainer.extend(
        out_generated_image(
            gen, dis,
            10, 10, args.seed, args.out, writer),
        trigger=snapshot_interval)

    if args.resume:
        # Resume from a snapshot
        chainer.serializers.load_npz(args.resume, trainer)

    # Run the training
    trainer.run()


if __name__ == '__main__':
    main()


================================================
FILE: examples/chainer/extension_logger/updater.py
================================================
#!/usr/bin/env python

from __future__ import print_function

import chainer
import chainer.functions as F
from chainer import Variable


class DCGANUpdater(chainer.training.StandardUpdater):

    def __init__(self, *args, **kwargs):
        self.gen, self.dis = kwargs.pop('models')
        super(DCGANUpdater, self).__init__(*args, **kwargs)

    def loss_dis(self, dis, y_fake, y_real):
        batchsize = len(y_fake)
        L1 = F.sum(F.softplus(-y_real)) / batchsize
        L2 = F.sum(F.softplus(y_fake)) / batchsize
        loss = L1 + L2
        chainer.report({'loss': loss}, dis)
        return loss

    def loss_gen(self, gen, y_fake):
        batchsize = len(y_fake)
        loss = F.sum(F.softplus(-y_fake)) / batchsize
        chainer.report({'loss': loss}, gen)
        return loss

    def update_core(self):
        gen_optimizer = self.get_optimizer('gen')
        dis_optimizer = self.get_optimizer('dis')

        batch = self.get_iterator('main').next()
        x_real = Variable(self.converter(batch, self.device)) / 255.
        xp = chainer.cuda.get_array_module(x_real.data)

        gen, dis = self.gen, self.dis
        batchsize = len(batch)

        y_real = dis(x_real)

        z = Variable(xp.asarray(gen.make_hidden(batchsize)))
        x_fake = gen(z)
        y_fake = dis(x_fake)

        dis_optimizer.update(self.loss_dis, dis, y_fake, y_real)
        gen_optimizer.update(self.loss_gen, gen, y_fake)


================================================
FILE: examples/chainer/extension_logger/visualize.py
================================================
#!/usr/bin/env python

import os

import numpy as np
from PIL import Image

import chainer
import chainer.cuda
from chainer import Variable


def out_generated_image(gen, dis, rows, cols, seed, dst, writer):
    @chainer.training.make_extension()
    def make_image(trainer):
        np.random.seed(seed)
        n_images = rows * cols
        xp = gen.xp
        z = Variable(xp.asarray(gen.make_hidden(n_images)))
        with chainer.using_config('train', False):
            x = gen(z)
        writer.add_image('img', x, trainer.updater.iteration)

    return make_image


================================================
FILE: examples/chainer/extension_logger/writetensorboard.py
================================================
import json
import os
import shutil
import tempfile

import six
from chainer import reporter
from chainer import serializer as serializer_module
from chainer.training import extension
from chainer.training import trigger as trigger_module


class LogTensorboard(extension.Extension):

    """Trainer extension to output the accumulated results to a log file.

    This extension accumulates the observations of the trainer to
    :class:`~chainer.DictSummary` at a regular interval specified by a supplied
    trigger, and writes them into a log file in JSON format.

    There are two triggers to handle this extension. One is the trigger to
    invoke this extension, which is used to handle the timing of accumulating
    the results. It is set to ``1, 'iteration'`` by default. The other is the
    trigger to determine when to emit the result. When this trigger returns
    True, this extension appends the summary of accumulated values to the list
    of past summaries, and writes the list to the log file. Then, this
    extension makes a new fresh summary object which is used until the next
    time that the trigger fires.

    It also adds some entries to each result dictionary.

    - ``'epoch'`` and ``'iteration'`` are the epoch and iteration counts at the
      output, respectively.
    - ``'elapsed_time'`` is the elapsed time in seconds since the training
      begins. The value is taken from :attr:`Trainer.elapsed_time`.

    Args:
        keys (iterable of strs): Keys of values to accumulate. If this is None,
            all the values are accumulated and output to the log file.
        trigger: Trigger that decides when to aggregate the result and output
            the values. This is distinct from the trigger of this extension
            itself. If it is a tuple in the form ``<int>, 'epoch'`` or
            ``<int>, 'iteration'``, it is passed to :class:`IntervalTrigger`.
        postprocess: Callback to postprocess the result dictionaries. Each
            result dictionary is passed to this callback on the output. This
            callback can modify the result dictionaries, which are used to
            output to the log file.
        log_name (str): Name of the log file under the output directory. It can
            be a format string: the last result dictionary is passed for the
            formatting. For example, users can use '{iteration}' to separate
            the log files for different iterations. If the log name is None, it
            does not output the log to any file.

    """

    def __init__(self, keys=None, trigger=(1, 'epoch'), postprocess=None,
                 log_name='log', logger=None):
        self._keys = keys
        self._trigger = trigger_module.get_trigger(trigger)
        self._postprocess = postprocess
        self._log_name = log_name
        self._log = []
        self._logger = logger
        self._init_summary()

    def __call__(self, trainer):
        # accumulate the observations
        keys = self._keys
        observation = trainer.observation
        summary = self._summary

        if keys is None:
            summary.add(observation)
        else:
            summary.add({k: observation[k] for k in keys if k in observation})
        for k, v in observation.items():
            #self._logger.add_scalar(k, chainer.cuda.to_cpu(observation[k].data), trainer.updater.iteration)
            self._logger.add_scalar(
                k, observation[k], trainer.updater.iteration)
        if self._trigger(trainer):
            # output the result
            stats = self._summary.compute_mean()
            stats_cpu = {}
            for name, value in six.iteritems(stats):
                stats_cpu[name] = float(value)  # copy to CPU

            updater = trainer.updater
            stats_cpu['epoch'] = updater.epoch
            stats_cpu['iteration'] = updater.iteration
            stats_cpu['elapsed_time'] = trainer.elapsed_time

            if self._postprocess is not None:
                self._postprocess(stats_cpu)

            self._log.append(stats_cpu)

            # write to the log file
            if self._log_name is not None:
                log_name = self._log_name.format(**stats_cpu)
                fd, path = tempfile.mkstemp(prefix=log_name, dir=trainer.out)
                with os.fdopen(fd, 'w') as f:
                    json.dump(self._log, f, indent=4)

                new_path = os.path.join(trainer.out, log_name)
                shutil.move(path, new_path)

            # reset the summary for the next output
            self._init_summary()

    @property
    def log(self):
        """The current list of observation dictionaries."""
        return self._log

    def serialize(self, serializer):
        if hasattr(self._trigger, 'serialize'):
            self._trigger.serialize(serializer['_trigger'])

        # Note that this serialization may lose some information of small
        # numerical differences.
        if isinstance(serializer, serializer_module.Serializer):
            log = json.dumps(self._log)
            serializer('_log', log)
        else:
            log = serializer('_log', '')
            self._log = json.loads(log)

    def _init_summary(self):
        self._summary = reporter.DictSummary()


================================================
FILE: examples/chainer/plain_logger/data.py
================================================
import gzip
import os

import numpy as np
import six
from six.moves.urllib import request

parent = 'http://yann.lecun.com/exdb/mnist'
train_images = 'train-images-idx3-ubyte.gz'
train_labels = 'train-labels-idx1-ubyte.gz'
test_images = 't10k-images-idx3-ubyte.gz'
test_labels = 't10k-labels-idx1-ubyte.gz'
num_train = 60000
num_test = 10000
dim = 784


def load_mnist(images, labels, num):
    data = np.zeros(num * dim, dtype=np.uint8).reshape((num, dim))
    target = np.zeros(num, dtype=np.uint8).reshape((num, ))

    with gzip.open(images, 'rb') as f_images,\
            gzip.open(labels, 'rb') as f_labels:
        f_images.read(16)
        f_labels.read(8)
        for i in six.moves.range(num):
            target[i] = ord(f_labels.read(1))
            for j in six.moves.range(dim):
                data[i, j] = ord(f_images.read(1))

    return data, target


def download_mnist_data():
    print('Downloading {:s}...'.format(train_images))
    request.urlretrieve('{:s}/{:s}'.format(parent, train_images), train_images)
    print('Done')
    print('Downloading {:s}...'.format(train_labels))
    request.urlretrieve('{:s}/{:s}'.format(parent, train_labels), train_labels)
    print('Done')
    print('Downloading {:s}...'.format(test_images))
    request.urlretrieve('{:s}/{:s}'.format(parent, test_images), test_images)
    print('Done')
    print('Downloading {:s}...'.format(test_labels))
    request.urlretrieve('{:s}/{:s}'.format(parent, test_labels), test_labels)
    print('Done')

    print('Converting training data...')
    data_train, target_train = load_mnist(train_images, train_labels,
                                          num_train)
    print('Done')
    print('Converting test data...')
    data_test, target_test = load_mnist(test_images, test_labels, num_test)
    mnist = {'data': np.append(data_train, data_test, axis=0),
             'target': np.append(target_train, target_test, axis=0)}
    print('Done')
    print('Save output...')
    with open('mnist.pkl', 'wb') as output:
        six.moves.cPickle.dump(mnist, output, -1)
    print('Done')
    print('Convert completed')


def load_mnist_data():
    if not os.path.exists('mnist.pkl'):
        download_mnist_data()
    with open('mnist.pkl', 'rb') as mnist_pickle:
        mnist = six.moves.cPickle.load(mnist_pickle)
    return mnist


================================================
FILE: examples/chainer/plain_logger/net.py
================================================
import six

import chainer
import chainer.functions as F
from chainer.functions.loss.vae import gaussian_kl_divergence
import chainer.links as L


class VAE(chainer.Chain):
    """Variational AutoEncoder"""

    def __init__(self, n_in, n_latent, n_h):
        super(VAE, self).__init__()
        with self.init_scope():
            # encoder
            self.le1 = L.Linear(n_in, n_h)
            self.le2_mu = L.Linear(n_h, n_latent)
            self.le2_ln_var = L.Linear(n_h, n_latent)
            # decoder
            self.ld1 = L.Linear(n_latent, n_h)
            self.ld2 = L.Linear(n_h, n_in)

    def __call__(self, x, sigmoid=True):
        """AutoEncoder"""
        return self.decode(self.encode(x)[0], sigmoid)

    def encode(self, x):
        h1 = F.tanh(self.le1(x))
        mu = self.le2_mu(h1)
        ln_var = self.le2_ln_var(h1)  # log(sigma**2)
        return mu, ln_var

    def decode(self, z, sigmoid=True):
        h1 = F.tanh(self.ld1(z))
        h2 = self.ld2(h1)
        if sigmoid:
            return F.sigmoid(h2)
        else:
            return h2

    def get_loss_func(self, C=1.0, k=1):
        """Get loss function of VAE.

        The loss value is equal to ELBO (Evidence Lower Bound)
        multiplied by -1.

        Args:
            C (int): Usually this is 1.0. Can be changed to control the
                second term of ELBO bound, which works as regularization.
            k (int): Number of Monte Carlo samples used in encoded vector.
        """
        def lf(x):
            mu, ln_var = self.encode(x)
            batchsize = len(mu.data)
            # reconstruction loss
            rec_loss = 0
            for l in six.moves.range(k):
                z = F.gaussian(mu, ln_var)
                rec_loss += F.bernoulli_nll(x, self.decode(z, sigmoid=False)) \
                    / (k * batchsize)
            self.rec_loss = rec_loss
            self.loss = self.rec_loss + \
                C * gaussian_kl_divergence(mu, ln_var) / batchsize
            return self.loss
        return lf


================================================
FILE: examples/chainer/plain_logger/train_vae.py
================================================
#!/usr/bin/env python
"""Chainer example: train a VAE on MNIST
"""
from __future__ import print_function
import argparse

import matplotlib
# Disable interactive backend
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import six

import chainer
from chainer import computational_graph
from chainer import cuda
from chainer import optimizers
from chainer import serializers
from tensorboardX import SummaryWriter
import data
import net

writer = SummaryWriter()

parser = argparse.ArgumentParser(description='Chainer example: MNIST')
parser.add_argument('--initmodel', '-m', default='',
                    help='Initialize the model from given file')
parser.add_argument('--resume', '-r', default='',
                    help='Resume the optimization from snapshot')
parser.add_argument('--gpu', '-g', default=-1, type=int,
                    help='GPU ID (negative value indicates CPU)')
parser.add_argument('--epoch', '-e', default=100, type=int,
                    help='number of epochs to learn')
parser.add_argument('--dimz', '-z', default=20, type=int,
                    help='dimention of encoded vector')
parser.add_argument('--batchsize', '-b', type=int, default=100,
                    help='learning minibatch size')
parser.add_argument('--test', action='store_true',
                    help='Use tiny datasets for quick tests')
args = parser.parse_args()

batchsize = args.batchsize
n_epoch = args.epoch
n_latent = args.dimz

writer.add_text('config', str(args))

print('GPU: {}'.format(args.gpu))
print('# dim z: {}'.format(args.dimz))
print('# Minibatch-size: {}'.format(args.batchsize))
print('# epoch: {}'.format(args.epoch))
print('')

# Prepare dataset
print('load MNIST dataset')
mnist = data.load_mnist_data()
mnist['data'] = mnist['data'].astype(np.float32)
mnist['data'] /= 255
mnist['target'] = mnist['target'].astype(np.int32)

if args.test:
    mnist['data'] = mnist['data'][0:100]
    mnist['target'] = mnist['target'][0:100]
    N = 30
else:
    N = 60000

x_train, x_test = np.split(mnist['data'],   [N])
y_train, y_test = np.split(mnist['target'], [N])
N_test = y_test.size

# Prepare VAE model, defined in net.py
model = net.VAE(784, n_latent, 500)
if args.gpu >= 0:
    cuda.get_device_from_id(args.gpu).use()
    model.to_gpu()
xp = np if args.gpu < 0 else cuda.cupy

# Setup optimizer
optimizer = optimizers.Adam()
optimizer.setup(model)

# Init/Resume
if args.initmodel:
    print('Load model from', args.initmodel)
    serializers.load_npz(args.initmodel, model)
if args.resume:
    print('Load optimizer state from', args.resume)
    serializers.load_npz(args.resume, optimizer)

# Learning loop
for epoch in six.moves.range(1, n_epoch + 1):
    print('epoch', epoch)

    # training
    perm = np.random.permutation(N)
    sum_loss = 0       # total loss
    sum_rec_loss = 0   # reconstruction loss
    for i in six.moves.range(0, N, batchsize):
        x = chainer.Variable(xp.asarray(x_train[perm[i:i + batchsize]]))
        optimizer.update(model.get_loss_func(), x)
        if epoch == 1 and i == 0:
            with open('graph.dot', 'w') as o:
                g = computational_graph.build_computational_graph(
                    (model.loss, ))
                o.write(g.dump())
            print('graph generated')
        writer.add_scalar('train/loss', model.loss, epoch * N + i)
        writer.add_scalar('train/rec_loss', model.rec_loss, epoch * N + i)
        sum_loss += float(model.loss.data) * len(x.data)
        sum_rec_loss += float(model.rec_loss.data) * len(x.data)

    print('train mean loss={}, mean reconstruction loss={}'
          .format(sum_loss / N, sum_rec_loss / N))

    # evaluation
    sum_loss = 0
    sum_rec_loss = 0
    with chainer.no_backprop_mode():
        for i in six.moves.range(0, N_test, batchsize):
            x = chainer.Variable(xp.asarray(x_test[i:i + batchsize]))
            loss_func = model.get_loss_func(k=10)
            loss_func(x)
            sum_loss += float(model.loss.data) * len(x.data)
            sum_rec_loss += float(model.rec_loss.data) * len(x.data)
            writer.add_scalar('test/loss', model.loss, epoch * N_test + i)
            writer.add_scalar('test/rec_loss', model.rec_loss,
                              epoch * N_test + i)
            writer.add_image('reconstructed', model(
                x).reshape(-1, 1, 28, 28), epoch * N_test + i)
            writer.add_image('input', x.reshape(-1, 1, 28, 28),
                             epoch * N_test + i)
            del model.loss
    print('test  mean loss={}, mean reconstruction loss={}'
          .format(sum_loss / N_test, sum_rec_loss / N_test))


# Save the model and the optimizer
print('save the model')
serializers.save_npz('mlp.model', model)
print('save the optimizer')
serializers.save_npz('mlp.state', optimizer)

model.to_cpu()


# original images and reconstructed images
def save_images(x, filename):
    fig, ax = plt.subplots(3, 3, figsize=(9, 9), dpi=100)
    for ai, xi in zip(ax.flatten(), x):
        ai.imshow(xi.reshape(28, 28))
    fig.savefig(filename)


train_ind = [1, 3, 5, 10, 2, 0, 13, 15, 17]
x = chainer.Variable(np.asarray(x_train[train_ind]))
with chainer.no_backprop_mode():
    x1 = model(x)
save_images(x.data, 'train')
save_images(x1.data, 'train_reconstructed')

test_ind = [3, 2, 1, 18, 4, 8, 11, 17, 61]
x = chainer.Variable(np.asarray(x_test[test_ind]))
with chainer.no_backprop_mode():
    x1 = model(x)
save_images(x.data, 'test')
save_images(x1.data, 'test_reconstructed')


# draw images from randomly sampled z
z = chainer.Variable(np.random.normal(0, 1, (9, n_latent)).astype(np.float32))
x = model.decode(z)
save_images(x.data, 'sampled')


================================================
FILE: examples/create_wit_samples.py
================================================

"""
https://archive.ics.uci.edu/ml/datasets/Heart+Disease
1. #3 (age)
2. #4 (sex)
3. #9 (cp)
4. #10 (trestbps)
5. #12 (chol)
6. #16 (fbs)
7. #19 (restecg)
8. #32 (thalach)
9. #38 (exang)
10. #40 (oldpeak)
11. #41 (slope)
12. #44 (ca)
13. #51 (thal)
14. #58 (num) (the predicted attribute)

ex: ['62', '0', '1', '140', '0', '?', '0', '143', '0', '0', '?', '?', '3', '2']

Here I only choose feature 1~8 for example.

"""


with open("processed.cleveland.data") as f:
    lines = f.readlines()

columns = ["age", "sex", "cp", "trestbps", "chol", "fbs", "restecg", "thalach", "target"]
features_targets = []
targets = []
for line in lines:
    x = line.strip().split(',')
    y = x[-1]
    if '?' in x[:8]:  # skip missing data
        continue
    ft = [float(i) for i in x[:8]+[y]]
    # print(ft)
    features_targets.append(ft)


"""
  The first line of the CSV file must contain column names.
  Each line after that contains one example from the dataset,
  with values for each of the columns defined on the first line.
  The pipe character ("|") deliminates separate feature values
  in a list of feature values for a given feature.
"""

with open("test.csv", 'w') as f:
    f.write(','.join(columns) + '\n')
    for feature in features_targets:
        feature = [str(i) for i in feature]
        f.write(','.join(feature) + '\n')

# launch tensorboard and fill [git/]tensorboardX/examples/test.csv in the WIT page and see the data distribution.

exit()


# For interactive inference, you may need the data in tfrecord format.

import tensorflow as tf


def to_examples(features_targets, columns=None):
    examples = []
    for row in features_targets:
        example = tf.train.Example()
        for i, col in enumerate(columns):
            example.features.feature[col].float_list.value.append(row[i])
            # example.features.feature[col].bytes_list.value.append(row[col].encode('utf-8'))
        examples.append(example)
    return examples

writer = tf.io.TFRecordWriter('test.tfrecord')
for example in to_examples(features_targets, columns):
    writer.write(example.SerializeToString())
writer.close()


# fill [git/]tensorboardX/examples/test.tfrecord in the WIT page and see the data distribution.


================================================
FILE: examples/demo.py
================================================
import torch
import torchvision.utils as vutils
import numpy as np
import torchvision.models as models
from torchvision import datasets
from tensorboardX import SummaryWriter
import datetime

try:
    import soundfile
    skip_audio = False
except ImportError:
    skip_audio = True

resnet18 = models.resnet18(weights=None)
writer = SummaryWriter()
sample_rate = 44100
freqs = [262, 294, 330, 349, 392, 440, 440, 440, 440, 440, 440]

true_positive_counts = [75, 64, 21, 5, 0]
false_positive_counts = [150, 105, 18, 0, 0]
true_negative_counts = [0, 45, 132, 150, 150]
false_negative_counts = [0, 11, 54, 70, 75]
precision = [0.3333333, 0.3786982, 0.5384616, 1.0, 0.0]
recall = [1.0, 0.8533334, 0.28, 0.0666667, 0.0]


for n_iter in range(100):
    with writer.use_metadata(global_step=n_iter):
        s1 = torch.rand(1)  # value to keep
        s2 = torch.rand(1)
        # data grouping by `slash`
        writer.add_scalar('data/scalar_systemtime', s1[0], summary_description="# markdown is supported!")
        # data grouping by `slash`
        writer.add_scalar('data/scalar_customtime', s1[0], walltime=n_iter, display_name="dudubird")
        writer.add_scalars('data/scalar_group', {"xsinx": n_iter * np.sin(n_iter),
                                                 "xcosx": n_iter * np.cos(n_iter),
                                                 "arctanx": np.arctan(n_iter)})
        x = torch.rand(32, 3, 64, 64)  # output from network
        if n_iter % 10 == 0:
            x = vutils.make_grid(x, normalize=True, scale_each=True)
            writer.add_image('Image', x)  # Tensor
            writer.add_image_with_boxes(
                'imagebox_label', torch.ones(3, 240, 240) * 0.5,
                torch.Tensor([[10, 10, 100, 100], [101, 101, 200, 200]]),
                labels=['abcde' + str(n_iter), 'fgh' + str(n_iter)])
            if not skip_audio:
                x = torch.zeros(sample_rate * 2)
                for i in range(x.size(0)):
                    # sound amplitude should in [-1, 1]
                    x[i] = np.cos(freqs[n_iter // 10] * np.pi *
                                  float(i) / float(sample_rate))
                writer.add_audio('myAudio', x)
            writer.add_text('Text', 'text logged at step:' + str(n_iter))
            writer.add_text('markdown Text', '''a|b\n-|-\nc|d''')
            for name, param in resnet18.named_parameters():
                if 'bn' not in name:
                    writer.add_histogram(name, param)
            writer.add_pr_curve('xoxo', np.random.randint(2, size=100), np.random.rand(
                100))  # needs tensorboard 0.4RC or later
            writer.add_pr_curve_raw('prcurve with raw data', true_positive_counts,
                                    false_positive_counts,
                                    true_negative_counts,
                                    false_negative_counts,
                                    precision,
                                    recall)
# export scalar data to JSON for external processing
writer.export_scalars_to_json("./all_scalars.json")

dataset = datasets.MNIST('mnist', train=False, download=True)
images = dataset.data[:100].float()
label = dataset.targets[:100]
features = images.view(100, 784)
writer.add_embedding(features, metadata=label, label_img=images.unsqueeze(1))
writer.add_embedding(features, global_step=1, tag='noMetadata')
images_train = dataset.data[100:200].float()
labels_train = dataset.targets[100:200]
features_train = images_train.view(100, 784)

all_features = torch.cat((features, features_train))
all_labels = torch.cat((label, labels_train))
all_images = torch.cat((images, images_train))
dataset_label = ['test'] * 100 + ['train'] * 100
all_labels = list(zip(all_labels, dataset_label))

writer.add_embedding(all_features, metadata=all_labels, label_img=all_images.unsqueeze(1),
                     metadata_header=['digit', 'dataset'], global_step=2)

# VIDEO
vid_images = dataset.data[:16 * 48]
vid = vid_images.view(16, 48, 1, 28, 28)  # BxTxCxHxW

writer.add_video('video', vid_tensor=vid)
writer.add_video('video_1_fps', vid_tensor=vid, fps=1)

writer.close()

writer.add_scalar('implicit reopen writer', 100, 0)


================================================
FILE: examples/demo_beholder.py
================================================
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an 'AS IS' BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Simple MNIST classifier to demonstrate features of Beholder.

Based on tensorflow/examples/tutorials/mnist/mnist_with_summaries.py.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy as np
import tensorboardX.beholder as beholder_lib
import time

from collections import namedtuple


LOG_DIRECTORY = '/tmp/beholder-demo'
tensor_and_name = namedtuple('tensor_and_name', 'tensor, name')


def beholder_pytorch():
    for i in range(1000):
        fake_param = [tensor_and_name(np.random.randn(128, 768, 3), 'test' + str(i))
                      for i in range(5)]
        arrays = [tensor_and_name(np.random.randn(128, 768, 3), 'test' + str(i))
                  for i in range(5)]
        beholder = beholder_lib.Beholder(logdir=LOG_DIRECTORY)
        beholder.update(
            trainable=fake_param,
            arrays=arrays,
            frame=np.random.randn(128, 128),
        )
        time.sleep(0.1)
        print(i)


if __name__ == '__main__':
    import os
    if not os.path.exists(LOG_DIRECTORY):
        os.makedirs(LOG_DIRECTORY)
    print(LOG_DIRECTORY)
    beholder_pytorch()


================================================
FILE: examples/demo_comet.py
================================================
from tensorboardX import SummaryWriter
import torch
import torchvision.utils as vutils
import numpy as np
import torchvision.models as models
from torchvision import datasets
import datetime

try:
    import soundfile
    skip_audio = False
except ImportError:
    skip_audio = True

resnet18 = models.resnet18(False)
writer = SummaryWriter(comet_config={"disabled": False,
                                     "workspace": 'tensorboardx-test',
                                     "project_name": 'tbx-ci',
                                     "api_key": "KOSKkXJ52qFZxkxYHlRJ7wOEk"})                               
sample_rate = 44100
freqs = [262, 294, 330, 349, 392, 440, 440, 440, 440, 440, 440]

true_positive_counts = [75, 64, 21, 5, 0]
false_positive_counts = [150, 105, 18, 0, 0]
true_negative_counts = [0, 45, 132, 150, 150]
false_negative_counts = [0, 11, 54, 70, 75]
precision = [0.3333333, 0.3786982, 0.5384616, 1.0, 0.0]
recall = [1.0, 0.8533334, 0.28, 0.0666667, 0.0]


for n_iter in range(100):
    s1 = torch.rand(1)  # value to keep
    s2 = torch.rand(1)
    # data grouping by `slash`
    writer.add_scalar('data/scalar_systemtime', s1[0], n_iter, summary_description="# markdown is supported!")
    # data grouping by `slash`
    writer.add_scalar('data/scalar_customtime', s1[0], n_iter, walltime=n_iter, display_name="dudubird")
    writer.add_scalars('data/scalar_group', {"xsinx": n_iter * np.sin(n_iter),
                                             "xcosx": n_iter * np.cos(n_iter),
                                             "arctanx": np.arctan(n_iter)}, n_iter)
    x = torch.rand(32, 3, 64, 64)  # output from network
    if n_iter % 10 == 0:
        x = vutils.make_grid(x, normalize=True, scale_each=True)
        writer.add_image('Image', x, n_iter)  # Tensor
        writer.add_image_with_boxes('imagebox_label', torch.ones(3, 240, 240) * 0.5,
             torch.Tensor([[10, 10, 100, 100], [101, 101, 200, 200]]),
             n_iter, 
             labels=['abcde' + str(n_iter), 'fgh' + str(n_iter)])
        if not skip_audio:
            x = torch.zeros(sample_rate * 2)
            for i in range(x.size(0)):
                # sound amplitude should in [-1, 1]
                x[i] = np.cos(freqs[n_iter // 10] * np.pi *
                            float(i) / float(sample_rate))
            writer.add_audio('myAudio', x, n_iter)
        writer.add_text('Text', 'text logged at step:' + str(n_iter), n_iter)
        writer.add_text('markdown Text', '''a|b\n-|-\nc|d''', n_iter)
        for name, param in resnet18.named_parameters():
            if 'bn' not in name:
                writer.add_histogram(name, param, n_iter)
        writer.add_pr_curve('xoxo', np.random.randint(2, size=100), np.random.rand(
            100), n_iter)  # needs tensorboard 0.4RC or later
        writer.add_pr_curve_raw('prcurve with raw data', true_positive_counts,
                                false_positive_counts,
                                true_negative_counts,
                                false_negative_counts,
                                precision,
                                recall, n_iter)
# export scalar data to JSON for external processing
writer.export_scalars_to_json("./all_scalars.json")

dataset = datasets.MNIST('mnist', train=False, download=True)
images = dataset.test_data[:100].float()
label = dataset.test_labels[:100]
features = images.view(100, 784)
writer.add_embedding(features, metadata=label, label_img=images.unsqueeze(1))
writer.add_embedding(features, global_step=1, tag='noMetadata')
dataset = datasets.MNIST('mnist', train=True, download=True)
images_train = dataset.train_data[:100].float()
labels_train = dataset.train_labels[:100]
features_train = images_train.view(100, 784)

all_features = torch.cat((features, features_train))
all_labels = torch.cat((label, labels_train))
all_images = torch.cat((images, images_train))
dataset_label = ['test'] * 100 + ['train'] * 100
all_labels = list(zip(all_labels, dataset_label))

writer.add_embedding(all_features, metadata=all_labels, label_img=all_images.unsqueeze(1),
                     metadata_header=['digit', 'dataset'], global_step=2)

# VIDEO
vid_images = dataset.train_data[:16 * 48]
vid = vid_images.view(16, 48, 1, 28, 28)  # BxTxCxHxW

writer.add_video('video', vid_tensor=vid)
writer.add_video('video_1_fps', vid_tensor=vid, fps=1)

writer.close()

writer.add_scalar('implicit reopen writer', 100, 0)


================================================
FILE: examples/demo_custom_scalars.py
================================================
from numpy.random import rand
from tensorboardX import SummaryWriter
import time


with SummaryWriter() as writer:
    for n_iter in range(100):
        writer.add_scalar('twse/0050', rand(), n_iter)
        writer.add_scalar('twse/2330', rand(), n_iter)
        t = rand()
        writer.add_scalar('dow/aaa', t, n_iter)
        writer.add_scalar('dow/bbb', t - 1, n_iter)
        writer.add_scalar('dow/ccc', t + 1, n_iter)
        writer.add_scalar('nasdaq/aaa', rand(), n_iter)
        writer.add_scalar('nasdaq/bbb', rand(), n_iter)
        writer.add_scalar('nasdaq/ccc', rand(), n_iter)

    layout = {'Taiwan': {'twse': ['Multiline', ['twse/0050', 'twse/2330']]},
              'USA': {'dow': ['Margin', ['dow/aaa', 'dow/bbb', 'dow/ccc']],
                      'nasdaq': ['Margin', ['nasdaq/aaa', 'nasdaq/bbb', 'nasdaq/ccc']]}}
    writer.add_custom_scalars(layout)
#    writer.add_custom_scalars(layout) second call has no effect

time.sleep(1)

with SummaryWriter() as writer:
    for n_iter in range(100):
        writer.add_scalar('twse/0050', rand(), n_iter)
        writer.add_scalar('twse/2330', rand(), n_iter)

    writer.add_custom_scalars_multilinechart(['twse/0050', 'twse/2330'])

time.sleep(1)

with SummaryWriter() as writer:
    for n_iter in range(100):
        t = rand()
        writer.add_scalar('dow/aaa', t, n_iter)
        writer.add_scalar('dow/bbb', t - 1, n_iter)
        writer.add_scalar('dow/ccc', t + 1, n_iter)

    writer.add_custom_scalars_marginchart(['dow/aaa', 'dow/bbb', 'dow/ccc'])


================================================
FILE: examples/demo_embedding.py
================================================
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
from torch.autograd.variable import Variable
from tensorboardX import SummaryWriter
from torch.utils.data import TensorDataset, DataLoader

# EMBEDDING VISUALIZATION FOR A TWO-CLASSES PROBLEM

# just a bunch of layers


class M(nn.Module):
    def __init__(self):
        super(M, self).__init__()
        self.cn1 = nn.Conv2d(in_channels=1, out_channels=64, kernel_size=3)
        self.cn2 = nn.Conv2d(in_channels=64, out_channels=32, kernel_size=3)
        self.fc1 = nn.Linear(in_features=128, out_features=2)

    def forward(self, i):
        i = self.cn1(i)
        i = F.relu(i)
        i = F.max_pool2d(i, 2)
        i = self.cn2(i)
        i = F.relu(i)
        i = F.max_pool2d(i, 2)
        i = i.view(len(i), -1)
        i = self.fc1(i)
        i = F.log_softmax(i, dim=1)
        return i

# get some random data around value


def get_data(value, shape):
    data = torch.ones(shape) * value
    # add some noise
    data += torch.randn(shape)**2
    return data


# dataset
# cat some data with different values
data = torch.cat(
    (get_data(
        0, (100, 1, 14, 14)), get_data(
            0.5, (100, 1, 14, 14))), 0)
# labels
labels = torch.cat((torch.zeros(100), torch.ones(100)), 0)
# generator
gen = DataLoader(TensorDataset(data, labels), batch_size=25, shuffle=True)
# network
m = M()
#loss and optim
loss = nn.NLLLoss()
optimizer = torch.optim.Adam(params=m.parameters())
# settings for train and log
num_epochs = 20
embedding_log = 5
writer = SummaryWriter(comment='mnist_embedding_training')

#writer = SummaryWriter("gs://your-bucket/embedding-test")
#writer = SummaryWriter("s3://your-bucket/embedding-test")

# TRAIN
for epoch in range(num_epochs):
    for j, sample in enumerate(gen):
        n_iter = (epoch * len(gen)) + j
        # reset grad
        m.zero_grad()
        optimizer.zero_grad()
        # get batch data
        data_batch = Variable(sample[0], requires_grad=True).float()
        label_batch = Variable(sample[1], requires_grad=False).long()
        # FORWARD
        out = m(data_batch)
        loss_value = loss(out, label_batch)
        # BACKWARD
        loss_value.backward()
        optimizer.step()
        # LOGGING
        writer.add_scalar('loss', loss_value.data.item(), n_iter)

        if j % embedding_log == 0:
            print("loss_value:{}".format(loss_value.data.item()))
            # we need 3 dimension for tensor to visualize it!
            out = torch.cat((out.data, torch.ones(len(out), 1)), 1)
            writer.add_embedding(
                out,
                metadata=label_batch.data,
                label_img=data_batch.data,
                global_step=n_iter)

writer.close()

# tensorboard --logdir runs
# you should now see a dropdown list with all the timestep,
# last timestep should have a visible separation between the two classes


================================================
FILE: examples/demo_global_writer.py
================================================
# This program show that you can use summary writer globally
# So that you can use the writer like the python.logging module

# This file triggers global_1 and global_2 to do their job.
import global_1
import time
time.sleep(2)
import global_2



================================================
FILE: examples/demo_graph.py
================================================
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torch.autograd import Variable
from tensorboardX import SummaryWriter

dummy_input = (torch.zeros(1, 3),)


class LinearInLinear(nn.Module):
    def __init__(self):
        super(LinearInLinear, self).__init__()
        self.l = nn.Linear(3, 5)

    def forward(self, x):
        return self.l(x)

with SummaryWriter(comment='LinearInLinear') as w:
    w.add_graph(LinearInLinear(), dummy_input, True)


class MultipleInput(nn.Module):
    def __init__(self):
        super(MultipleInput, self).__init__()
        self.Linear_1 = nn.Linear(3, 5)


    def forward(self, x, y):
        return self.Linear_1(x+y)

with SummaryWriter(comment='MultipleInput') as w:
    w.add_graph(MultipleInput(), (torch.zeros(1, 3), torch.zeros(1, 3)), True)

class MultipleOutput(nn.Module):
    def __init__(self):
        super(MultipleOutput, self).__init__()
        self.Linear_1 = nn.Linear(3, 5)
        self.Linear_2 = nn.Linear(3, 7)

    def forward(self, x):
        return self.Linear_1(x), self.Linear_2(x)

with SummaryWriter(comment='MultipleOutput') as w:
    w.add_graph(MultipleOutput(), dummy_input, True)


class MultipleOutput_shared(nn.Module):
    def __init__(self):
        super(MultipleOutput_shared, self).__init__()
        self.Linear_1 = nn.Linear(3, 5)

    def forward(self, x):
        return self.Linear_1(x), self.Linear_1(x)

with SummaryWriter(comment='MultipleOutput_shared') as w:
    w.add_graph(MultipleOutput_shared(), dummy_input, True)


class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()

    def forward(self, x):
        return x * 2


model = SimpleModel()
dummy_input = (torch.zeros(1, 2, 3),)

with SummaryWriter(comment='constantModel') as w:
    w.add_graph(model, dummy_input, True)


def conv3x3(in_planes, out_planes, stride=1):
    """3x3 convolution with padding"""
    return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
                     padding=1, bias=False)


class BasicBlock(nn.Module):
    expansion = 1

    def __init__(self, inplanes, planes, stride=1, downsample=None):
        super(BasicBlock, self).__init__()
        self.conv1 = conv3x3(inplanes, planes, stride)
        self.bn1 = nn.BatchNorm2d(planes)
        # self.relu = nn.ReLU(inplace=True)
        self.conv2 = conv3x3(planes, planes)
        self.bn2 = nn.BatchNorm2d(planes)
        self.stride = stride

    def forward(self, x):
        residual = x

        out = self.conv1(x)
        out = self.bn1(out)
        out = F.relu(out)
        out = self.conv2(out)
        out = self.bn2(out)
        out += residual
        out = F.relu(out)
        return out


dummy_input = torch.rand(1, 3, 224, 224)

with SummaryWriter(comment='basicblock') as w:
    model = BasicBlock(3, 3)
    w.add_graph(model, (dummy_input, ), verbose=True)




class Net1(nn.Module):
    def __init__(self):
        super(Net1, self).__init__()
        self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
        self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
        self.conv2_drop = nn.Dropout2d()
        self.fc1 = nn.Linear(320, 50)
        self.fc2 = nn.Linear(50, 10)
        self.bn = nn.BatchNorm2d(20)

    def forward(self, x):
        x = F.max_pool2d(self.conv1(x), 2)
        x = F.relu(x) + F.relu(-x)
        x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
        x = self.bn(x)
        x = x.view(-1, 320)
        x = F.relu(self.fc1(x))
        x = F.dropout(x, training=self.training)
        x = self.fc2(x)
        x = F.softmax(x, dim=1)
        return x


class Net2(nn.Module):
    def __init__(self):
        super(Net2, self).__init__()
        self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
        self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
        self.conv2_drop = nn.Dropout2d()
        self.fc1 = nn.Linear(320, 50)
        self.fc2 = nn.Linear(50, 10)

    def forward(self, x):
        x = F.relu(F.max_pool2d(self.conv1(x), 2))
        x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
        x = x.view(-1, 320)
        x = F.relu(self.fc1(x))
        x = F.dropout(x, training=self.training)
        x = self.fc2(x)
        x = F.log_softmax(x, dim=1)
        return x


dummy_input = Variable(torch.rand(13, 1, 28, 28))

model = Net1()
with SummaryWriter(comment='Net1') as w:
    w.add_graph(model, (dummy_input, ))

model = Net2()
with SummaryWriter(comment='Net2') as w:
    w.add_graph(model, (dummy_input, ))


class SiameseNetwork(nn.Module):
    def __init__(self):
        super(SiameseNetwork, self).__init__()
        self.cnn1 = Net1()

    def forward_once(self, x):
        output = self.cnn1(x)
        return output

    def forward(self, input1, input2):
        output1 = self.forward_once(input1)
        output2 = self.forward_once(input2)
        return output1, output2

model = SiameseNetwork()
with SummaryWriter(comment='SiameseNetwork') as w:
    w.add_graph(model, (dummy_input, dummy_input))


dummy_input = torch.Tensor(1, 3, 224, 224)

with SummaryWriter(comment='alexnet') as w:
    model = torchvision.models.alexnet()
    w.add_graph(model, (dummy_input, ))

with SummaryWriter(comment='vgg19') as w:
    model = torchvision.models.vgg19()
    w.add_graph(model, (dummy_input, ))

with SummaryWriter(comment='densenet121') as w:
    model = torchvision.models.densenet121()
    w.add_graph(model, (dummy_input, ))

with SummaryWriter(comment='resnet18') as w:
    model = torchvision.models.resnet18()
    w.add_graph(model, (dummy_input, ))



class RNN(nn.Module):
    def __init__(self, input_size, hidden_size, output_size):
        super(RNN, self).__init__()
        self.hidden_size = hidden_size
        self.i2h = nn.Linear(
            n_categories +
            input_size +
            hidden_size,
            hidden_size)
        self.i2o = nn.Linear(
            n_categories +
            input_size +
            hidden_size,
            output_size)
        self.o2o = nn.Linear(hidden_size + output_size, output_size)
        self.dropout = nn.Dropout(0.1)
        self.softmax = nn.LogSoftmax(dim=1)

    def forward(self, category, input, hidden):
        input_combined = torch.cat((category, input, hidden), 1)
        hidden = self.i2h(input_combined)
        output = self.i2o(input_combined)
        output_combined = torch.cat((hidden, output), 1)
        output = self.o2o(output_combined)
        output = self.dropout(output)
        output = self.softmax(output)
        return output, hidden, input

    def initHidden(self):
        return torch.zeros(1, self.hidden_size)


n_letters = 100
n_hidden = 128
n_categories = 10
rnn = RNN(n_letters, n_hidden, n_categories)
cat = torch.Tensor(1, n_categories)
dummy_input = torch.Tensor(1, n_letters)
hidden = torch.Tensor(1, n_hidden)


out, hidden, input = rnn(cat, dummy_input, hidden)
with SummaryWriter(comment='RNN') as w:
    w.add_graph(rnn, (cat, dummy_input, hidden), verbose=False)



lstm = torch.nn.LSTM(3, 3)  # Input dim is 3, output dim is 3
inputs = [torch.randn(1, 3) for _ in range(5)]  # make a sequence of length 5

# initialize the hidden state.
hidden = (torch.randn(1, 1, 3),
          torch.randn(1, 1, 3))
for i in inputs:
    out, hidden = lstm(i.view(1, 1, -1), hidden)

with SummaryWriter(comment='lstm') as w:
    w.add_graph(lstm, (torch.randn(1, 3).view(1, 1, -1), hidden), verbose=True)


import pytest
print('expect error here:')
with pytest.raises(Exception) as e_info:
    dummy_input = torch.rand(1, 1, 224, 224)
    with SummaryWriter(comment='basicblock_error') as w:
        w.add_graph(model, (dummy_input, ))  # error


================================================
FILE: examples/demo_hogwild.py
================================================
from __future__ import print_function
import argparse
import os
import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import torch.multiprocessing as mp
from torchvision import datasets, transforms
from tensorboardX import GlobalSummaryWriter


# Training settings
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')
parser.add_argument('--batch-size', type=int, default=64, metavar='N',
                    help='input batch size for training (default: 64)')
parser.add_argument('--test-batch-size', type=int, default=1000, metavar='N',
                    help='input batch size for testing (default: 1000)')
parser.add_argument('--epochs', type=int, default=2, metavar='N',
                    help='number of epochs to train (default: 10)')
parser.add_argument('--lr', type=float, default=0.01, metavar='LR',
                    help='learning rate (default: 0.01)')
parser.add_argument('--momentum', type=float, default=0.5, metavar='M',
                    help='SGD momentum (default: 0.5)')
parser.add_argument('--seed', type=int, default=1, metavar='S',
                    help='random seed (default: 1)')
parser.add_argument('--log-interval', type=int, default=10, metavar='N',
                    help='how many batches to wait before logging training status')
parser.add_argument('--num-processes', type=int, default=2, metavar='N',
                    help='how many training processes to use (default: 2)')
parser.add_argument('--cuda', action='store_true', default=False,
                    help='enables CUDA training')

class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
        self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
        self.conv2_drop = nn.Dropout2d()
        self.fc1 = nn.Linear(320, 50)
        self.fc2 = nn.Linear(50, 10)

    def forward(self, x):
        x = F.relu(F.max_pool2d(self.conv1(x), 2))
        x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
        x = x.view(-1, 320)
        x = F.relu(self.fc1(x))
        x = F.dropout(x, training=self.training)
        x = self.fc2(x)
        return F.log_softmax(x, dim=1)


def train(rank, args, model, device, dataloader_kwargs):
    torch.manual_seed(args.seed + rank)

    train_loader = torch.utils.data.DataLoader(
        datasets.MNIST('../data', train=True, download=True,
                    transform=transforms.Compose([
                        transforms.ToTensor(),
                        transforms.Normalize((0.1307,), (0.3081,))
                    ])),
        batch_size=args.batch_size, shuffle=True, num_workers=1,
        **dataloader_kwargs)

    optimizer = optim.SGD(model.parameters(), lr=args.lr, momentum=args.momentum)
    for epoch in range(1, args.epochs + 1):
        train_epoch(epoch, args, model, device, train_loader, optimizer)

def train_epoch(epoch, args, model, device, data_loader, optimizer):
    model.train()
    pid = os.getpid()
    for batch_idx, (data, target) in enumerate(data_loader):
        optimizer.zero_grad()
        output = model(data.to(device))
        loss = F.nll_loss(output, target.to(device))
        loss.backward()
        optimizer.step()
        if batch_idx % args.log_interval == 0:
            writer.add_scalar("Loss", loss)
            print('{}\tTrain Epoch: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format(
                pid, epoch, batch_idx * len(data), len(data_loader.dataset),
                100. * batch_idx / len(data_loader), loss.item()))

writer = GlobalSummaryWriter()

if __name__ == '__main__':
    args = parser.parse_args()

    use_cuda = args.cuda and torch.cuda.is_available()
    device = torch.device("cuda" if use_cuda else "cpu")
    dataloader_kwargs = {'pin_memory': True} if use_cuda else {}

    torch.manual_seed(args.seed)
    # mp.set_start_method('spawn')

    model = Net().to(device)
    model.share_memory() # gradients are allocated lazily, so they are not shared here
    processes = []
    for rank in range(args.num_processes):
        p = mp.Process(target=train, args=(rank, args, model, device, dataloader_kwargs))
        # We first train the model across `num_processes` processes
        p.start()
        processes.append(p)
    for p in processes:
        p.join()



================================================
FILE: examples/demo_hparams.py
================================================
from tensorboardX import SummaryWriter
import time
import random


hparam = {'lr': [0.1, 0.01, 0.001],
          'bsize': [1, 2, 4],
          'n_hidden': [100, 200],
          'bn': [True, False]}

metrics = {'accuracy', 'loss'}

def train(lr, bsize, n_hidden):
    x = random.random()
    return x, x*5

i = 0
with SummaryWriter() as w:
    for lr in hparam['lr']:
        for bsize in hparam['bsize']:
            for n_hidden in hparam['n_hidden']:
                for bn in hparam['bn']:
                    accu, loss = train(lr, bsize, n_hidden)
                    i = i + 1
                    w.add_hparams({'lr': lr, 'bsize': bsize, 'n_hidden': n_hidden, 'bn': bn},
                                    {'accuracy': accu, 'loss': loss}, name="trial"+str(i))



================================================
FILE: examples/demo_matplotlib.py
================================================
import matplotlib.pyplot as plt
plt.switch_backend('agg')

fig = plt.figure()

c1 = plt.Circle((0.2, 0.5), 0.2, color='r')
c2 = plt.Circle((0.8, 0.5), 0.2, color='r')

ax = plt.gca()
ax.add_patch(c1)
ax.add_patch(c2)
plt.axis('scaled')


from tensorboardX import SummaryWriter
writer = SummaryWriter()
writer.add_figure('matplotlib', fig)
writer.close()


================================================
FILE: examples/demo_mesh.py
================================================
import numpy as np
from tensorboardX import SummaryWriter
from numpy.random import randint


def draw_fusilli(turns, radius, omega):
    points = []
    faces = []
    colors = []
    for t in range(turns):
        for theta in np.linspace(0, 2 * np.pi, 100, endpoint=False):
            z = (theta + 2 * np.pi * t) * omega
            end_point = radius * np.cos(theta), radius * np.sin(theta), z
            center_point = 0, 0, z
            points.append(center_point)
            points.append(end_point)


    # The frontend stays silent even if you assigned 
    # non-existing points, be careful.
    for n in range(0, len(points)-3, 2):
        faces.append((n, n+1, n+3))

    for _ in range(len(points)):
        colors.append((randint(100, 200),
                       randint(100, 200),
                       randint(100, 200)))

    return np.array([points]), np.array([colors]), np.array([faces])


with SummaryWriter() as w: 
    points, colors, faces = draw_fusilli(5, 1, 0.1)
    w.add_mesh("my_mesh1", points, colors, faces, global_step=0)
   
    for i in range(1, 10):
        points, colors, faces = draw_fusilli(randint(4, 7), 1, 0.1*randint(1,3))
        points += randint(-5, 5)
        w.add_mesh("my_mesh1", points, colors, faces, global_step=i)


================================================
FILE: examples/demo_multiple_embedding.py
================================================
import math
import numpy as np
from tensorboardX import SummaryWriter


def main():
    degrees = np.linspace(0, 3600 * math.pi / 180.0, 3600)
    degrees = degrees.reshape(3600, 1)
    labels = ["%d" % (i) for i in range(0, 3600)]

    with SummaryWriter() as writer:
        # Maybe make a bunch of data that's always shifted in some
        # way, and that will be hard for PCA to turn into a sphere?

        for epoch in range(0, 16):
            shift = epoch * 2 * math.pi / 16.0
            mat = np.concatenate([
                np.sin(shift + degrees * 2 * math.pi / 180.0),
                np.sin(shift + degrees * 3 * math.pi / 180.0),
                np.sin(shift + degrees * 5 * math.pi / 180.0),
                np.sin(shift + degrees * 7 * math.pi / 180.0),
                np.sin(shift + degrees * 11 * math.pi / 180.0)
            ], axis=1)
            writer.add_embedding(
                mat=mat,
                metadata=labels,
                tag="sin",
                global_step=epoch)

            mat = np.concatenate([
                np.cos(shift + degrees * 2 * math.pi / 180.0),
                np.cos(shift + degrees * 3 * math.pi / 180.0),
                np.cos(shift + degrees * 5 * math.pi / 180.0),
                np.cos(shift + degrees * 7 * math.pi / 180.0),
                np.cos(shift + degrees * 11 * math.pi / 180.0)
            ], axis=1)
            writer.add_embedding(
                mat=mat,
                metadata=labels,
                tag="cos",
                global_step=epoch)

            mat = np.concatenate([
                np.tan(shift + degrees * 2 * math.pi / 180.0),
                np.tan(shift + degrees * 3 * math.pi / 180.0),
                np.tan(shift + degrees * 5 * math.pi / 180.0),
                np.tan(shift + degrees * 7 * math.pi / 180.0),
                np.tan(shift + degrees * 11 * math.pi / 180.0)
            ], axis=1)
            writer.add_embedding(
                mat=mat,
                metadata=labels,
                tag="tan",
                global_step=epoch)


if __name__ == "__main__":
    main()

# tensorboard --logdir runs
# Under "Projection, you should see
#  48 tensor found named
#     cos:cos-00000 to cos:cos-00016
#     sin:sin-00000 to sin:sin-00016
#     tan:tan-00000 to tan:tan-00016


================================================
FILE: examples/demo_multiprocessing.py
================================================
from tensorboardX import GlobalSummaryWriter
import multiprocessing as mp
import time
import os
import psutil
import torch
import numpy as np

w = GlobalSummaryWriter()


def train3():
    for i in range(100):
        w.add_scalar('many_write_in_func', np.random.randn())
        time.sleep(0.01*np.random.randint(0, 10))

def train2(x):
    np.random.seed(x)
    w.add_scalar('few_write_per_func/1', np.random.randn())
    time.sleep(0.05*np.random.randint(0, 10))
    w.add_scalar('few_write_per_func/2', np.random.randn())

def train(x):

    w.add_scalar('poolmap/1', x*np.random.randn())
    time.sleep(0.05*np.random.randint(0, 10))
    w.add_scalar('poolmap/2', x*np.random.randn())



if __name__ == '__main__':

    with mp.Pool() as pool:
        pool.map(train, range(100))


    processes = []
    for i in range(4):
        p0 = mp.Process(target=train2, args=(i,))
        p1 = mp.Process(target=train3)
        processes.append(p0)
        processes.append(p1)
        p0.start()
        p1.start()

    for p in processes:
        p.join()

    w.close()

================================================
FILE: examples/demo_nvidia_smi.py
================================================
"""
write gpu and (gpu) memory usage of nvidia cards as scalar
"""
from tensorboardX import SummaryWriter
import time
import torch
try:
    import nvidia_smi
    nvidia_smi.nvmlInit()
    handle = nvidia_smi.nvmlDeviceGetHandleByIndex(0)  # gpu0
except ImportError:
    print('This demo needs nvidia-ml-py or nvidia-ml-py3')
    exit()


with SummaryWriter() as writer:
    x = []
    for n_iter in range(50):
        x.append(torch.Tensor(1000, 1000).cuda())
        res = nvidia_smi.nvmlDeviceGetUtilizationRates(handle)
        writer.add_scalar('nv/gpu', res.gpu, n_iter)
        res = nvidia_smi.nvmlDeviceGetMemoryInfo(handle)
        writer.add_scalar('nv/gpu_mem', res.used, n_iter)
        time.sleep(0.1)


================================================
FILE: examples/demo_onnx.py
================================================
from tensorboardX import SummaryWriter

import subprocess
zoo_address = 'https://onnxzoo.blob.core.windows.net/models/opset_8/mnist/mnist.tar.gz'

res = subprocess.call(['wget', '-nc', zoo_address])
assert res == 0, 'cannot download example onnx model from the zoo'
res = subprocess.call(['tar', 'xf', 'mnist.tar.gz', '-C', 'examples/', 'mnist/model.onnx'])



with SummaryWriter() as w:
    w.add_onnx_graph('examples/mnist/model.onnx')
    # w.add_onnx_graph('/Users/dexter/Downloads/resnet50/model.onnx')


================================================
FILE: examples/demo_openvino.py
================================================
from tensorboardX import SummaryWriter
with SummaryWriter() as w:
    # https://download.01.org/opencv/2019/open_model_zoo/R3/20190905_163000_models_bin/mobilenetv2-int8-sparse-v1-tf-0001/FP32/mobilenetv2-int8-sparse-v1-tf-0001.xml
    w.add_openvino_graph('examples/mobilenetv2.xml')



================================================
FILE: examples/demo_purge.py
================================================
from time import sleep
from tensorboardX import SummaryWriter

with SummaryWriter(logdir='runs/purge') as w:
    for i in range(100):
        w.add_scalar('purgetest', i, i)

sleep(1.0)

with SummaryWriter(logdir='runs/purge', purge_step=42) as w:
    # event 42~99 are removed (inclusively)
    for i in range(42, 100):
        w.add_scalar('purgetest', 42, i)


================================================
FILE: examples/global_1.py
================================================
# called by demo_global_writer

from tensorboardX import GlobalSummaryWriter

writer = GlobalSummaryWriter.getSummaryWriter()

writer.add_text('my_log', 'greeting from global1')

for i in range(100):
    writer.add_scalar('global1', i)

for i in range(100):
    writer.add_scalar('common', i)

================================================
FILE: examples/global_2.py
================================================
# called by demo_global_writer

from tensorboardX import GlobalSummaryWriter

writer = GlobalSummaryWriter.getSummaryWriter()

writer.add_text('my_log', 'greeting from global2')

for i in range(100):
    writer.add_scalar('global2', i)

for i in range(100):
    writer.add_scalar('common', i)

================================================
FILE: examples/mobilenetv2.xml
================================================
<?xml version="1.0" ?>
<net batch="1" name="mobilenetv2-int8-sparse-v1-tf-0001" version="6">
	<layers>
		<layer id="0" name="net_input" precision="FP32" type="Input">
			<output>
				<port id="0">
					<dim>1</dim>
					<dim>3</dim>
					<dim>224</dim>
					<dim>224</dim>
				</port>
			</output>
		</layer>
		<layer id="1" name="Mul_/Fused_Mul_/FusedScaleShift_" precision="FP32" type="ScaleShift">
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>3</dim>
					<dim>224</dim>
					<dim>224</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>3</dim>
					<dim>224</dim>
					<dim>224</dim>
				</port>
			</output>
			<blobs>
				<weights offset="0" size="12"/>
				<biases offset="12" size="12"/>
			</blobs>
		</layer>
		<layer id="2" name="quant_model/MobilenetV2/Conv/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="3,3" output="32" pads_begin="0,0" pads_end="1,1" strides="2,2"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>3</dim>
					<dim>224</dim>
					<dim>224</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>32</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</output>
			<blobs>
				<weights offset="24" size="3456"/>
				<biases offset="3480" size="128"/>
			</blobs>
		</layer>
		<layer id="3" name="quant_model/MobilenetV2/Conv/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>32</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</output>
		</layer>
		<layer id="4" name="quant_model/MobilenetV2/expanded_conv/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="32" kernel="3,3" output="32" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>32</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</output>
			<blobs>
				<weights offset="3608" size="1152"/>
				<biases offset="4760" size="128"/>
			</blobs>
		</layer>
		<layer id="5" name="quant_model/MobilenetV2/expanded_conv/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>32</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</output>
		</layer>
		<layer id="6" name="quant_model/MobilenetV2/expanded_conv/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="16" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>16</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</output>
			<blobs>
				<weights offset="4888" size="2048"/>
				<biases offset="6936" size="64"/>
			</blobs>
		</layer>
		<layer id="7" name="quant_model/MobilenetV2/expanded_conv_1/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="96" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>16</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>96</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</output>
			<blobs>
				<weights offset="7000" size="6144"/>
				<biases offset="13144" size="384"/>
			</blobs>
		</layer>
		<layer id="8" name="quant_model/MobilenetV2/expanded_conv_1/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>96</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</output>
		</layer>
		<layer id="9" name="quant_model/MobilenetV2/expanded_conv_1/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="96" kernel="3,3" output="96" pads_begin="0,0" pads_end="1,1" strides="2,2"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>112</dim>
					<dim>112</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>96</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
			<blobs>
				<weights offset="13528" size="3456"/>
				<biases offset="16984" size="384"/>
			</blobs>
		</layer>
		<layer id="10" name="quant_model/MobilenetV2/expanded_conv_1/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>96</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
		</layer>
		<layer id="11" name="quant_model/MobilenetV2/expanded_conv_1/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="24" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>24</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
			<blobs>
				<weights offset="17368" size="9216"/>
				<biases offset="26584" size="96"/>
			</blobs>
		</layer>
		<layer id="12" name="quant_model/MobilenetV2/expanded_conv_2/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="144" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>24</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
			<blobs>
				<weights offset="26680" size="13824"/>
				<biases offset="40504" size="576"/>
			</blobs>
		</layer>
		<layer id="13" name="quant_model/MobilenetV2/expanded_conv_2/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
		</layer>
		<layer id="14" name="quant_model/MobilenetV2/expanded_conv_2/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="144" kernel="3,3" output="144" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
			<blobs>
				<weights offset="41080" size="5184"/>
				<biases offset="46264" size="576"/>
			</blobs>
		</layer>
		<layer id="15" name="quant_model/MobilenetV2/expanded_conv_2/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
		</layer>
		<layer id="16" name="quant_model/MobilenetV2/expanded_conv_2/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="24" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>24</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
			<blobs>
				<weights offset="46840" size="13824"/>
				<biases offset="60664" size="96"/>
			</blobs>
		</layer>
		<layer id="17" name="quant_model/MobilenetV2/expanded_conv_2/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>24</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>24</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>24</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
		</layer>
		<layer id="18" name="quant_model/MobilenetV2/expanded_conv_3/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="144" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>24</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
			<blobs>
				<weights offset="60760" size="13824"/>
				<biases offset="74584" size="576"/>
			</blobs>
		</layer>
		<layer id="19" name="quant_model/MobilenetV2/expanded_conv_3/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</output>
		</layer>
		<layer id="20" name="quant_model/MobilenetV2/expanded_conv_3/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="144" kernel="3,3" output="144" pads_begin="0,0" pads_end="1,1" strides="2,2"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>144</dim>
					<dim>56</dim>
					<dim>56</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>144</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="75160" size="5184"/>
				<biases offset="80344" size="576"/>
			</blobs>
		</layer>
		<layer id="21" name="quant_model/MobilenetV2/expanded_conv_3/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>144</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>144</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
		</layer>
		<layer id="22" name="quant_model/MobilenetV2/expanded_conv_3/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="32" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>144</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="80920" size="18432"/>
				<biases offset="99352" size="128"/>
			</blobs>
		</layer>
		<layer id="23" name="quant_model/MobilenetV2/expanded_conv_4/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="192" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="99480" size="24576"/>
				<biases offset="124056" size="768"/>
			</blobs>
		</layer>
		<layer id="24" name="quant_model/MobilenetV2/expanded_conv_4/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
		</layer>
		<layer id="25" name="quant_model/MobilenetV2/expanded_conv_4/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="192" kernel="3,3" output="192" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="124824" size="6912"/>
				<biases offset="131736" size="768"/>
			</blobs>
		</layer>
		<layer id="26" name="quant_model/MobilenetV2/expanded_conv_4/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
		</layer>
		<layer id="27" name="quant_model/MobilenetV2/expanded_conv_4/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="32" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="132504" size="24576"/>
				<biases offset="157080" size="128"/>
			</blobs>
		</layer>
		<layer id="28" name="quant_model/MobilenetV2/expanded_conv_4/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
		</layer>
		<layer id="29" name="quant_model/MobilenetV2/expanded_conv_5/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="192" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="157208" size="24576"/>
				<biases offset="181784" size="768"/>
			</blobs>
		</layer>
		<layer id="30" name="quant_model/MobilenetV2/expanded_conv_5/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
		</layer>
		<layer id="31" name="quant_model/MobilenetV2/expanded_conv_5/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="192" kernel="3,3" output="192" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="182552" size="6912"/>
				<biases offset="189464" size="768"/>
			</blobs>
		</layer>
		<layer id="32" name="quant_model/MobilenetV2/expanded_conv_5/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
		</layer>
		<layer id="33" name="quant_model/MobilenetV2/expanded_conv_5/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="32" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="190232" size="24576"/>
				<biases offset="214808" size="128"/>
			</blobs>
		</layer>
		<layer id="34" name="quant_model/MobilenetV2/expanded_conv_5/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
		</layer>
		<layer id="35" name="quant_model/MobilenetV2/expanded_conv_6/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="192" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>32</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
			<blobs>
				<weights offset="214936" size="24576"/>
				<biases offset="239512" size="768"/>
			</blobs>
		</layer>
		<layer id="36" name="quant_model/MobilenetV2/expanded_conv_6/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</output>
		</layer>
		<layer id="37" name="quant_model/MobilenetV2/expanded_conv_6/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="192" kernel="3,3" output="192" pads_begin="0,0" pads_end="1,1" strides="2,2"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>28</dim>
					<dim>28</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>192</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="240280" size="6912"/>
				<biases offset="247192" size="768"/>
			</blobs>
		</layer>
		<layer id="38" name="quant_model/MobilenetV2/expanded_conv_6/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>192</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="39" name="quant_model/MobilenetV2/expanded_conv_6/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="64" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>192</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="247960" size="49152"/>
				<biases offset="297112" size="256"/>
			</blobs>
		</layer>
		<layer id="40" name="quant_model/MobilenetV2/expanded_conv_7/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="384" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="297368" size="98304"/>
				<biases offset="395672" size="1536"/>
			</blobs>
		</layer>
		<layer id="41" name="quant_model/MobilenetV2/expanded_conv_7/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="42" name="quant_model/MobilenetV2/expanded_conv_7/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="384" kernel="3,3" output="384" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="397208" size="13824"/>
				<biases offset="411032" size="1536"/>
			</blobs>
		</layer>
		<layer id="43" name="quant_model/MobilenetV2/expanded_conv_7/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="44" name="quant_model/MobilenetV2/expanded_conv_7/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="64" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="412568" size="98304"/>
				<biases offset="510872" size="256"/>
			</blobs>
		</layer>
		<layer id="45" name="quant_model/MobilenetV2/expanded_conv_7/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="46" name="quant_model/MobilenetV2/expanded_conv_8/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="384" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="511128" size="98304"/>
				<biases offset="609432" size="1536"/>
			</blobs>
		</layer>
		<layer id="47" name="quant_model/MobilenetV2/expanded_conv_8/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="48" name="quant_model/MobilenetV2/expanded_conv_8/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="384" kernel="3,3" output="384" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="610968" size="13824"/>
				<biases offset="624792" size="1536"/>
			</blobs>
		</layer>
		<layer id="49" name="quant_model/MobilenetV2/expanded_conv_8/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="50" name="quant_model/MobilenetV2/expanded_conv_8/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="64" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="626328" size="98304"/>
				<biases offset="724632" size="256"/>
			</blobs>
		</layer>
		<layer id="51" name="quant_model/MobilenetV2/expanded_conv_8/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="52" name="quant_model/MobilenetV2/expanded_conv_9/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="384" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="724888" size="98304"/>
				<biases offset="823192" size="1536"/>
			</blobs>
		</layer>
		<layer id="53" name="quant_model/MobilenetV2/expanded_conv_9/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="54" name="quant_model/MobilenetV2/expanded_conv_9/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="384" kernel="3,3" output="384" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="824728" size="13824"/>
				<biases offset="838552" size="1536"/>
			</blobs>
		</layer>
		<layer id="55" name="quant_model/MobilenetV2/expanded_conv_9/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="56" name="quant_model/MobilenetV2/expanded_conv_9/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="64" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="840088" size="98304"/>
				<biases offset="938392" size="256"/>
			</blobs>
		</layer>
		<layer id="57" name="quant_model/MobilenetV2/expanded_conv_9/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="58" name="quant_model/MobilenetV2/expanded_conv_10/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="384" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>64</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="938648" size="98304"/>
				<biases offset="1036952" size="1536"/>
			</blobs>
		</layer>
		<layer id="59" name="quant_model/MobilenetV2/expanded_conv_10/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="60" name="quant_model/MobilenetV2/expanded_conv_10/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="384" kernel="3,3" output="384" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="1038488" size="13824"/>
				<biases offset="1052312" size="1536"/>
			</blobs>
		</layer>
		<layer id="61" name="quant_model/MobilenetV2/expanded_conv_10/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="62" name="quant_model/MobilenetV2/expanded_conv_10/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="96" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>384</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="1053848" size="147456"/>
				<biases offset="1201304" size="384"/>
			</blobs>
		</layer>
		<layer id="63" name="quant_model/MobilenetV2/expanded_conv_11/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="576" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="1201688" size="221184"/>
				<biases offset="1422872" size="2304"/>
			</blobs>
		</layer>
		<layer id="64" name="quant_model/MobilenetV2/expanded_conv_11/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="65" name="quant_model/MobilenetV2/expanded_conv_11/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="576" kernel="3,3" output="576" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="1425176" size="20736"/>
				<biases offset="1445912" size="2304"/>
			</blobs>
		</layer>
		<layer id="66" name="quant_model/MobilenetV2/expanded_conv_11/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="67" name="quant_model/MobilenetV2/expanded_conv_11/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="96" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="1448216" size="221184"/>
				<biases offset="1669400" size="384"/>
			</blobs>
		</layer>
		<layer id="68" name="quant_model/MobilenetV2/expanded_conv_11/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="69" name="quant_model/MobilenetV2/expanded_conv_12/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="576" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="1669784" size="221184"/>
				<biases offset="1890968" size="2304"/>
			</blobs>
		</layer>
		<layer id="70" name="quant_model/MobilenetV2/expanded_conv_12/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="71" name="quant_model/MobilenetV2/expanded_conv_12/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="576" kernel="3,3" output="576" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="1893272" size="20736"/>
				<biases offset="1914008" size="2304"/>
			</blobs>
		</layer>
		<layer id="72" name="quant_model/MobilenetV2/expanded_conv_12/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="73" name="quant_model/MobilenetV2/expanded_conv_12/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="96" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="1916312" size="221184"/>
				<biases offset="2137496" size="384"/>
			</blobs>
		</layer>
		<layer id="74" name="quant_model/MobilenetV2/expanded_conv_12/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="75" name="quant_model/MobilenetV2/expanded_conv_13/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="576" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>96</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
			<blobs>
				<weights offset="2137880" size="221184"/>
				<biases offset="2359064" size="2304"/>
			</blobs>
		</layer>
		<layer id="76" name="quant_model/MobilenetV2/expanded_conv_13/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</output>
		</layer>
		<layer id="77" name="quant_model/MobilenetV2/expanded_conv_13/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="576" kernel="3,3" output="576" pads_begin="0,0" pads_end="1,1" strides="2,2"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>14</dim>
					<dim>14</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>576</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="2361368" size="20736"/>
				<biases offset="2382104" size="2304"/>
			</blobs>
		</layer>
		<layer id="78" name="quant_model/MobilenetV2/expanded_conv_13/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>576</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="79" name="quant_model/MobilenetV2/expanded_conv_13/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="160" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>576</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="2384408" size="368640"/>
				<biases offset="2753048" size="640"/>
			</blobs>
		</layer>
		<layer id="80" name="quant_model/MobilenetV2/expanded_conv_14/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="960" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="2753688" size="614400"/>
				<biases offset="3368088" size="3840"/>
			</blobs>
		</layer>
		<layer id="81" name="quant_model/MobilenetV2/expanded_conv_14/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="82" name="quant_model/MobilenetV2/expanded_conv_14/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="960" kernel="3,3" output="960" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="3371928" size="34560"/>
				<biases offset="3406488" size="3840"/>
			</blobs>
		</layer>
		<layer id="83" name="quant_model/MobilenetV2/expanded_conv_14/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="84" name="quant_model/MobilenetV2/expanded_conv_14/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="160" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="3410328" size="614400"/>
				<biases offset="4024728" size="640"/>
			</blobs>
		</layer>
		<layer id="85" name="quant_model/MobilenetV2/expanded_conv_14/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="86" name="quant_model/MobilenetV2/expanded_conv_15/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="960" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="4025368" size="614400"/>
				<biases offset="4639768" size="3840"/>
			</blobs>
		</layer>
		<layer id="87" name="quant_model/MobilenetV2/expanded_conv_15/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="88" name="quant_model/MobilenetV2/expanded_conv_15/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="960" kernel="3,3" output="960" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="4643608" size="34560"/>
				<biases offset="4678168" size="3840"/>
			</blobs>
		</layer>
		<layer id="89" name="quant_model/MobilenetV2/expanded_conv_15/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="90" name="quant_model/MobilenetV2/expanded_conv_15/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="160" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="4682008" size="614400"/>
				<biases offset="5296408" size="640"/>
			</blobs>
		</layer>
		<layer id="91" name="quant_model/MobilenetV2/expanded_conv_15/add" precision="FP32" type="Eltwise">
			<data operation="sum"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
				<port id="1">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="92" name="quant_model/MobilenetV2/expanded_conv_16/expand/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="960" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>160</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="5297048" size="614400"/>
				<biases offset="5911448" size="3840"/>
			</blobs>
		</layer>
		<layer id="93" name="quant_model/MobilenetV2/expanded_conv_16/expand/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="94" name="quant_model/MobilenetV2/expanded_conv_16/depthwise/depthwise_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="960" kernel="3,3" output="960" pads_begin="1,1" pads_end="1,1" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="5915288" size="34560"/>
				<biases offset="5949848" size="3840"/>
			</blobs>
		</layer>
		<layer id="95" name="quant_model/MobilenetV2/expanded_conv_16/depthwise/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="96" name="quant_model/MobilenetV2/expanded_conv_16/project/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="320" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>960</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>320</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="5953688" size="1228800"/>
				<biases offset="7182488" size="1280"/>
			</blobs>
		</layer>
		<layer id="97" name="quant_model/MobilenetV2/Conv_1/Conv2D_Fold" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="1280" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>320</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>1280</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
			<blobs>
				<weights offset="7183768" size="1638400"/>
				<biases offset="8822168" size="5120"/>
			</blobs>
		</layer>
		<layer id="98" name="quant_model/MobilenetV2/Conv_1/Relu6" precision="FP32" type="Clamp">
			<data max="6" min="0"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>1280</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>1280</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</output>
		</layer>
		<layer id="99" name="quant_model/MobilenetV2/Logits/AvgPool" precision="FP32" type="Pooling">
			<data auto_pad="valid" exclude-pad="true" kernel="7,7" pads_begin="0,0" pads_end="0,0" pool-method="avg" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>1280</dim>
					<dim>7</dim>
					<dim>7</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>1280</dim>
					<dim>1</dim>
					<dim>1</dim>
				</port>
			</output>
		</layer>
		<layer id="100" name="quant_model/MobilenetV2/Logits/Conv2d_1c_1x1/Conv2D" precision="FP32" type="Convolution">
			<data auto_pad="same_upper" dilations="1,1" group="1" kernel="1,1" output="1001" pads_begin="0,0" pads_end="0,0" strides="1,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>1280</dim>
					<dim>1</dim>
					<dim>1</dim>
				</port>
			</input>
			<output>
				<port id="3">
					<dim>1</dim>
					<dim>1001</dim>
					<dim>1</dim>
					<dim>1</dim>
				</port>
			</output>
			<blobs>
				<weights offset="8827288" size="5125120"/>
				<biases offset="13952408" size="4004"/>
			</blobs>
		</layer>
		<layer id="101" name="quant_model/MobilenetV2/Logits/Conv2d_1c_1x1/act_quant/FakeQuantWithMinMaxVars/Transpose" precision="FP32" type="Permute">
			<data order="0,2,3,1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>1001</dim>
					<dim>1</dim>
					<dim>1</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>1</dim>
					<dim>1</dim>
					<dim>1001</dim>
				</port>
			</output>
		</layer>
		<layer id="102" name="quant_model/MobilenetV2/Logits/Squeeze/Dims/Output_0/Data__const" precision="I32" type="Const">
			<output>
				<port id="1">
					<dim>2</dim>
				</port>
			</output>
			<blobs>
				<custom offset="13956412" size="8"/>
			</blobs>
		</layer>
		<layer id="103" name="quant_model/MobilenetV2/Logits/Squeeze" precision="FP32" type="Squeeze">
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>1</dim>
					<dim>1</dim>
					<dim>1001</dim>
				</port>
				<port id="1">
					<dim>2</dim>
				</port>
			</input>
			<output>
				<port id="2">
					<dim>1</dim>
					<dim>1001</dim>
				</port>
			</output>
		</layer>
		<layer id="104" name="net_output" precision="FP32" type="SoftMax">
			<data axis="1"/>
			<input>
				<port id="0">
					<dim>1</dim>
					<dim>1001</dim>
				</port>
			</input>
			<output>
				<port id="1">
					<dim>1</dim>
					<dim>1001</dim>
				</port>
			</output>
		</layer>
	</layers>
	<edges>
		<edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
		<edge from-layer="1" from-port="3" to-layer="2" to-port="0"/>
		<edge from-layer="2" from-port="3" to-layer="3" to-port="0"/>
		<edge from-layer="3" from-port="1" to-layer="4" to-port="0"/>
		<edge from-layer="4" from-port="3" to-layer="5" to-port="0"/>
		<edge from-layer="5" from-port="1" to-layer="6" to-port="0"/>
		<edge from-layer="6" from-port="3" to-layer="7" to-port="0"/>
		<edge from-layer="7" from-port="3" to-layer="8" to-port="0"/>
		<edge from-layer="8" from-port="1" to-layer="9" to-port="0"/>
		<edge from-layer="9" from-port="3" to-layer="10" to-port="0"/>
		<edge from-layer="10" from-port="1" to-layer="11" to-port="0"/>
		<edge from-layer="11" from-port="3" to-layer="12" to-port="0"/>
		<edge from-layer="12" from-port="3" to-layer="13" to-port="0"/>
		<edge from-layer="13" from-port="1" to-layer="14" to-port="0"/>
		<edge from-layer="14" from-port="3" to-layer="15" to-port="0"/>
		<edge from-layer="15" from-port="1" to-layer="16" to-port="0"/>
		<edge from-layer="16" from-port="3" to-layer="17" to-port="0"/>
		<edge from-layer="11" from-port="3" to-layer="17" to-port="1"/>
		<edge from-layer="17" from-port="2" to-layer="18" to-port="0"/>
		<edge from-layer="18" from-port="3" to-layer="19" to-port="0"/>
		<edge from-layer="19" from-port="1" to-layer="20" to-port="0"/>
		<edge from-layer="20" from-port="3" to-layer="21" to-port="0"/>
		<edge from-layer="21" from-port="1" to-layer="22" to-port="0"/>
		<edge from-layer="22" from-port="3" to-layer="23" to-port="0"/>
		<edge from-layer="23" from-port="3" to-layer="24" to-port="0"/>
		<edge from-layer="24" from-port="1" to-layer="25" to-port="0"/>
		<edge from-layer="25" from-port="3" to-layer="26" to-port="0"/>
		<edge from-layer="26" from-port="1" to-layer="27" to-port="0"/>
		<edge from-layer="27" from-port="3" to-layer="28" to-port="0"/>
		<edge from-layer="22" from-port="3" to-layer="28" to-port="1"/>
		<edge from-layer="28" from-port="2" to-layer="29" to-port="0"/>
		<edge from-layer="29" from-port="3" to-layer="30" to-port="0"/>
		<edge from-layer="30" from-port="1" to-layer="31" to-port="0"/>
		<edge from-layer="31" from-port="3" to-layer="32" to-port="0"/>
		<edge from-layer="32" from-port="1" to-layer="33" to-port="0"/>
		<edge from-layer="33" from-port="3" to-layer="34" to-port="0"/>
		<edge from-layer="28" from-port="2" to-layer="34" to-port="1"/>
		<edge from-layer="34" from-port="2" to-layer="35" to-port="0"/>
		<edge from-layer="35" from-port="3" to-layer="36" to-port="0"/>
		<edge from-layer="36" from-port="1" to-layer="37" to-port="0"/>
		<edge from-layer="37" from-port="3" to-layer="38" to-port="0"/>
		<edge from-layer="38" from-port="1" to-layer="39" to-port="0"/>
		<edge from-layer="39" from-port="3" to-layer="40" to-port="0"/>
		<edge from-layer="40" from-port="3" to-layer="41" to-port="0"/>
		<edge from-layer="41" from-port="1" to-layer="42" to-port="0"/>
		<edge from-layer="42" from-port="3" to-layer="43" to-port="0"/>
		<edge from-layer="43" from-port="1" to-layer="44" to-port="0"/>
		<edge from-layer="44" from-port="3" to-layer="45" to-port="0"/>
		<edge from-layer="39" from-port="3" to-layer="45" to-port="1"/>
		<edge from-layer="45" from-port="2" to-layer="46" to-port="0"/>
		<edge from-layer="46" from-port="3" to-layer="47" to-port="0"/>
		<edge from-layer="47" from-port="1" to-layer="48" to-port="0"/>
		<edge from-layer="48" from-port="3" to-layer="49" to-port="0"/>
		<edge from-layer="49" from-port="1" to-layer="50" to-port="0"/>
		<edge from-layer="50" from-port="3" to-layer="51" to-port="0"/>
		<edge from-layer="45" from-port="2" to-layer="51" to-port="1"/>
		<edge from-layer="51" from-port="2" to-layer="52" to-port="0"/>
		<edge from-layer="52" from-port="3" to-layer="53" to-port="0"/>
		<edge from-layer="53" from-port="1" to-layer="54" to-port="0"/>
		<edge from-layer="54" from-port="3" to-layer="55" to-port="0"/>
		<edge from-layer="55" from-port="1" to-layer="56" to-port="0"/>
		<edge from-layer="56" from-port="3" to-layer="57" to-port="0"/>
		<edge from-layer="51" from-port="2" to-layer="57" to-port="1"/>
		<edge from-layer="57" from-port="2" to-layer="58" to-port="0"/>
		<edge from-layer="58" from-port="3" to-layer="59" to-port="0"/>
		<edge from-layer="59" from-port="1" to-layer="60" to-port="0"/>
		<edge from-layer="60" from-port="3" to-layer="61" to-port="0"/>
		<edge from-layer="61" from-port="1" to-layer="62" to-port="0"/>
		<edge from-layer="62" from-port="3" to-layer="63" to-port="0"/>
		<edge from-layer="63" from-port="3" to-layer="64" to-port="0"/>
		<edge from-layer="64" from-port="1" to-layer="65" to-port="0"/>
		<edge from-layer="65" from-port="3" to-layer="66" to-port="0"/>
		<edge from-layer="66" from-port="1" to-layer="67" to-port="0"/>
		<edge from-layer="67" from-port="3" to-layer="68" to-port="0"/>
		<edge from-layer="62" from-port="3" to-layer="68" to-port="1"/>
		<edge from-layer="68" from-port="2" to-layer="69" to-port="0"/>
		<edge from-layer="69" from-port="3" to-layer="70" to-port="0"/>
		<edge from-layer="70" from-port="1" to-layer="71" to-port="0"/>
		<edge from-layer="71" from-port="3" to-layer="72" to-port="0"/>
		<edge from-layer="72" from-port="1" to-layer="73" to-port="0"/>
		<edge from-layer="73" from-port="3" to-layer="74" to-port="0"/>
		<edge from-layer="68" from-port="2" to-layer="74" to-port="1"/>
		<edge from-layer="74" from-port="2" to-layer="75" to-port="0"/>
		<edge from-layer="75" from-port="3" to-layer="76" to-port="0"/>
		<edge from-layer="76" from-port="1" to-layer="77" to-port="0"/>
		<edge from-layer="77" from-port="3" to-layer="78" to-port="0"/>
		<edge from-layer="78" from-port="1" to-layer="79" to-port="0"/>
		<edge from-layer="79" from-port="3" to-layer="80" to-port="0"/>
		<edge from-layer="80" from-port="3" to-layer="81" to-port="0"/>
		<edge from-layer="81" from-port="1" to-layer="82" to-port="0"/>
		<edge from-layer="82" from-port="3" to-layer="83" to-port="0"/>
		<edge from-layer="83" from-port="1" to-layer="84" to-port="0"/>
		<edge from-layer="84" from-port="3" to-layer="85" to-port="0"/>
		<edge from-layer="79" from-port="3" to-layer="85" to-port="1"/>
		<edge from-layer="85" from-port="2" to-layer="86" to-port="0"/>
		<edge from-layer="86" from-port="3" to-layer="87" to-port="0"/>
		<edge from-layer="87" from-port="1" to-layer="88" to-port="0"/>
		<edge from-layer="88" from-port="3" to-layer="89" to-port="0"/>
		<edge from-layer="89" from-port="1" to-layer="90" to-port="0"/>
		<edge from-layer="90" from-port="3" to-layer="91" to-port="0"/>
		<edge from-layer="85" from-port="2" to-layer="91" to-port="1"/>
		<edge from-layer="91" from-port="2" to-layer="92" to-port="0"/>
		<edge from-layer="92" from-port="3" to-layer="93" to-port="0"/>
		<edge from-layer="93" from-port="1" to-layer="94" to-port="0"/>
		<edge from-layer="94" from-port="3" to-layer="95" to-port="0"/>
		<edge from-layer="95" from-port="1" to-layer="96" to-port="0"/>
		<edge from-layer="96" from-port="3" to-layer="97" to-port="0"/>
		<edge from-layer="97" from-port="3" to-layer="98" to-port="0"/>
		<edge from-layer="98" from-port="1" to-layer="99" to-port="0"/>
		<edge from-layer="99" from-port="1" to-layer="100" to-port="0"/>
		<edge from-layer="100" from-port="3" to-layer="101" to-port="0"/>
		<edge from-layer="101" from-port="1" to-layer="103" to-port="0"/>
		<edge from-layer="102" from-port="1" to-layer="103" to-port="1"/>
		<edge from-layer="103" from-port="2" to-layer="104" to-port="0"/>
	</edges>
	<statistics>
		<layer>
			<name>quant_model/MobilenetV2/expanded_conv_12/add</name>
			<min>-32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991, -32.70615348509991</min>
			<max>30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419, 30.95849642864419</max>
		</layer>
		<layer>
			<name>quant_model/MobilenetV2/expanded_conv_10/project/Conv2D_Fold</name>
			<min>-21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966, -21.67422158010966</min>
			<max>21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944, 21.170169915455944</max>
		</layer>
		<layer>
			<name>quant_model/MobilenetV2/expanded_conv_13/depthwise/Relu6</name>
			<min>0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0</min>
			<max>5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995, 5.9997619362406995</max>
		</layer>
		<layer>
			<name>quant_model/MobilenetV2/expanded_conv_14/depthwise/Relu6</name>
			<min>0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
Download .txt
gitextract_40nonxya/

├── .codecov.yml
├── .flake8
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature-requests-or-general-questions.md
│   └── workflows/
│       ├── build-wheel.yml
│       ├── publish-pypi.yml
│       └── test-matrix.yml
├── .gitignore
├── .readthedocs.yaml
├── HISTORY.rst
├── LICENSE
├── MANIFEST.in
├── README.md
├── compile.sh
├── docs/
│   ├── Makefile
│   ├── conf.py
│   ├── index.rst
│   ├── requirements.txt
│   ├── tensorboard.rst
│   ├── tutorial.rst
│   ├── tutorial_zh.rst
│   └── utils.rst
├── examples/
│   ├── RUN_AFTER_PIP_INSTALL
│   ├── __init__.py
│   ├── chainer/
│   │   ├── extension_logger/
│   │   │   ├── net.py
│   │   │   ├── train_dcgan.py
│   │   │   ├── updater.py
│   │   │   ├── visualize.py
│   │   │   └── writetensorboard.py
│   │   └── plain_logger/
│   │       ├── data.py
│   │       ├── net.py
│   │       └── train_vae.py
│   ├── create_wit_samples.py
│   ├── demo.py
│   ├── demo_beholder.py
│   ├── demo_comet.py
│   ├── demo_custom_scalars.py
│   ├── demo_embedding.py
│   ├── demo_global_writer.py
│   ├── demo_graph.py
│   ├── demo_hogwild.py
│   ├── demo_hparams.py
│   ├── demo_matplotlib.py
│   ├── demo_mesh.py
│   ├── demo_multiple_embedding.py
│   ├── demo_multiprocessing.py
│   ├── demo_nvidia_smi.py
│   ├── demo_onnx.py
│   ├── demo_openvino.py
│   ├── demo_purge.py
│   ├── global_1.py
│   ├── global_2.py
│   ├── mobilenetv2.xml
│   └── processed.cleveland.data
├── pyproject.toml
├── run_pytest.sh
├── tensorboardX/
│   ├── __init__.py
│   ├── comet_utils.py
│   ├── crc32c.py
│   ├── embedding.py
│   ├── event_file_writer.py
│   ├── global_writer.py
│   ├── onnx_graph.py
│   ├── openvino_graph.py
│   ├── proto/
│   │   ├── __init__.py
│   │   ├── api.proto
│   │   ├── api_pb2.py
│   │   ├── attr_value.proto
│   │   ├── attr_value_pb2.py
│   │   ├── event.proto
│   │   ├── event_pb2.py
│   │   ├── graph.proto
│   │   ├── graph_pb2.py
│   │   ├── layout.proto
│   │   ├── layout_pb2.py
│   │   ├── node_def.proto
│   │   ├── node_def_pb2.py
│   │   ├── plugin_hparams.proto
│   │   ├── plugin_hparams_pb2.py
│   │   ├── plugin_mesh.proto
│   │   ├── plugin_mesh_pb2.py
│   │   ├── plugin_pr_curve.proto
│   │   ├── plugin_pr_curve_pb2.py
│   │   ├── plugin_text.proto
│   │   ├── plugin_text_pb2.py
│   │   ├── resource_handle.proto
│   │   ├── resource_handle_pb2.py
│   │   ├── summary.proto
│   │   ├── summary_pb2.py
│   │   ├── tensor.proto
│   │   ├── tensor_pb2.py
│   │   ├── tensor_shape.proto
│   │   ├── tensor_shape_pb2.py
│   │   ├── types.proto
│   │   ├── types_pb2.py
│   │   ├── versions.proto
│   │   └── versions_pb2.py
│   ├── record_writer.py
│   ├── summary.py
│   ├── torchvis.py
│   ├── utils.py
│   ├── visdom_writer.py
│   ├── writer.py
│   └── x2num.py
├── test-requirements.txt
└── tests/
    ├── __init__.py
    ├── event_file_writer_test.py
    ├── expect/
    │   ├── caffe_mnist.expect
    │   ├── caffe_overfeat.expect
    │   ├── test_caffe2.test_simple_cnnmodel.expect
    │   ├── test_caffe2.test_simple_model.expect
    │   ├── test_pr_curve.test_pr_purve.expect
    │   ├── test_pr_curve.test_pr_purve_raw.expect
    │   ├── test_summary.test_audio.expect
    │   ├── test_summary.test_custom_scalars.expect
    │   ├── test_summary.test_float32_image.expect
    │   ├── test_summary.test_histogram_auto.expect
    │   ├── test_summary.test_histogram_doane.expect
    │   ├── test_summary.test_histogram_fd.expect
    │   ├── test_summary.test_hparams.expect
    │   ├── test_summary.test_hparams_bool.expect
    │   ├── test_summary.test_hparams_string.expect
    │   ├── test_summary.test_image_with_3_channel_batched.expect
    │   ├── test_summary.test_image_with_boxes.expect
    │   ├── test_summary.test_image_with_four_channel.expect
    │   ├── test_summary.test_image_with_four_channel_batched.expect
    │   ├── test_summary.test_image_with_one_channel.expect
    │   ├── test_summary.test_image_with_one_channel_batched.expect
    │   ├── test_summary.test_image_without_channel.expect
    │   ├── test_summary.test_mesh.expect
    │   ├── test_summary.test_text.expect
    │   ├── test_summary.test_uint8_image.expect
    │   └── test_summary.test_video.expect
    ├── expect_reader.py
    ├── mnist-8.onnx
    ├── record_writer_test.py
    ├── test_chainer_np.py
    ├── test_crc32c.py
    ├── test_embedding.py
    ├── test_figure.py
    ├── test_hparams.py
    ├── test_lint.py
    ├── test_multiprocess_write.py
    ├── test_numpy.py
    ├── test_onnx_graph.py
    ├── test_openvino_graph.py
    ├── test_pr_curve.py
    ├── test_pytorch_graph.py
    ├── test_pytorch_np.py
    ├── test_record_writer.py
    ├── test_summary.py
    ├── test_summary_writer.py
    ├── test_utils.py
    ├── test_visdom.py
    └── test_writer.py
Download .txt
SYMBOL INDEX (406 symbols across 53 files)

FILE: examples/chainer/extension_logger/net.py
  function add_noise (line 13) | def add_noise(h, sigma=0.2):
  class Generator (line 21) | class Generator(chainer.Chain):
    method __init__ (line 23) | def __init__(self, n_hidden, bottom_width=4, ch=512, wscale=0.02):
    method make_hidden (line 42) | def make_hidden(self, batchsize):
    method __call__ (line 46) | def __call__(self, z):
  class Discriminator (line 56) | class Discriminator(chainer.Chain):
    method __init__ (line 58) | def __init__(self, bottom_width=4, ch=512, wscale=0.02):
    method __call__ (line 77) | def __call__(self, x):

FILE: examples/chainer/extension_logger/train_dcgan.py
  function main (line 19) | def main():

FILE: examples/chainer/extension_logger/updater.py
  class DCGANUpdater (line 10) | class DCGANUpdater(chainer.training.StandardUpdater):
    method __init__ (line 12) | def __init__(self, *args, **kwargs):
    method loss_dis (line 16) | def loss_dis(self, dis, y_fake, y_real):
    method loss_gen (line 24) | def loss_gen(self, gen, y_fake):
    method update_core (line 30) | def update_core(self):

FILE: examples/chainer/extension_logger/visualize.py
  function out_generated_image (line 13) | def out_generated_image(gen, dis, rows, cols, seed, dst, writer):

FILE: examples/chainer/extension_logger/writetensorboard.py
  class LogTensorboard (line 13) | class LogTensorboard(extension.Extension):
    method __init__ (line 56) | def __init__(self, keys=None, trigger=(1, 'epoch'), postprocess=None,
    method __call__ (line 66) | def __call__(self, trainer):
    method log (line 111) | def log(self):
    method serialize (line 115) | def serialize(self, serializer):
    method _init_summary (line 128) | def _init_summary(self):

FILE: examples/chainer/plain_logger/data.py
  function load_mnist (line 18) | def load_mnist(images, labels, num):
  function download_mnist_data (line 34) | def download_mnist_data():
  function load_mnist_data (line 64) | def load_mnist_data():

FILE: examples/chainer/plain_logger/net.py
  class VAE (line 9) | class VAE(chainer.Chain):
    method __init__ (line 12) | def __init__(self, n_in, n_latent, n_h):
    method __call__ (line 23) | def __call__(self, x, sigmoid=True):
    method encode (line 27) | def encode(self, x):
    method decode (line 33) | def decode(self, z, sigmoid=True):
    method get_loss_func (line 41) | def get_loss_func(self, C=1.0, k=1):

FILE: examples/chainer/plain_logger/train_vae.py
  function save_images (line 148) | def save_images(x, filename):

FILE: examples/create_wit_samples.py
  function to_examples (line 66) | def to_examples(features_targets, columns=None):

FILE: examples/demo_beholder.py
  function beholder_pytorch (line 35) | def beholder_pytorch():

FILE: examples/demo_embedding.py
  class M (line 14) | class M(nn.Module):
    method __init__ (line 15) | def __init__(self):
    method forward (line 21) | def forward(self, i):
  function get_data (line 36) | def get_data(value, shape):

FILE: examples/demo_graph.py
  class LinearInLinear (line 11) | class LinearInLinear(nn.Module):
    method __init__ (line 12) | def __init__(self):
    method forward (line 16) | def forward(self, x):
  class MultipleInput (line 23) | class MultipleInput(nn.Module):
    method __init__ (line 24) | def __init__(self):
    method forward (line 29) | def forward(self, x, y):
  class MultipleOutput (line 35) | class MultipleOutput(nn.Module):
    method __init__ (line 36) | def __init__(self):
    method forward (line 41) | def forward(self, x):
  class MultipleOutput_shared (line 48) | class MultipleOutput_shared(nn.Module):
    method __init__ (line 49) | def __init__(self):
    method forward (line 53) | def forward(self, x):
  class SimpleModel (line 60) | class SimpleModel(nn.Module):
    method __init__ (line 61) | def __init__(self):
    method forward (line 64) | def forward(self, x):
  function conv3x3 (line 75) | def conv3x3(in_planes, out_planes, stride=1):
  class BasicBlock (line 81) | class BasicBlock(nn.Module):
    method __init__ (line 84) | def __init__(self, inplanes, planes, stride=1, downsample=None):
    method forward (line 93) | def forward(self, x):
  class Net1 (line 115) | class Net1(nn.Module):
    method __init__ (line 116) | def __init__(self):
    method forward (line 125) | def forward(self, x):
  class Net2 (line 138) | class Net2(nn.Module):
    method __init__ (line 139) | def __init__(self):
    method forward (line 147) | def forward(self, x):
  class SiameseNetwork (line 169) | class SiameseNetwork(nn.Module):
    method __init__ (line 170) | def __init__(self):
    method forward_once (line 174) | def forward_once(self, x):
    method forward (line 178) | def forward(self, input1, input2):
  class RNN (line 208) | class RNN(nn.Module):
    method __init__ (line 209) | def __init__(self, input_size, hidden_size, output_size):
    method forward (line 226) | def forward(self, category, input, hidden):
    method initHidden (line 236) | def initHidden(self):

FILE: examples/demo_hogwild.py
  class Net (line 34) | class Net(nn.Module):
    method __init__ (line 35) | def __init__(self):
    method forward (line 43) | def forward(self, x):
  function train (line 53) | def train(rank, args, model, device, dataloader_kwargs):
  function train_epoch (line 69) | def train_epoch(epoch, args, model, device, data_loader, optimizer):

FILE: examples/demo_hparams.py
  function train (line 13) | def train(lr, bsize, n_hidden):

FILE: examples/demo_mesh.py
  function draw_fusilli (line 6) | def draw_fusilli(turns, radius, omega):

FILE: examples/demo_multiple_embedding.py
  function main (line 6) | def main():

FILE: examples/demo_multiprocessing.py
  function train3 (line 12) | def train3():
  function train2 (line 17) | def train2(x):
  function train (line 23) | def train(x):

FILE: tensorboardX/comet_utils.py
  class CometLogger (line 20) | class CometLogger:
    method __init__ (line 21) | def __init__(self, comet_config={"disabled": True}):
    method _requiresComet (line 30) | def _requiresComet(method):
    method end (line 55) | def end(self):
    method log_metric (line 61) | def log_metric(self, tag, display_name, value, step=None, epoch=None,
    method log_metrics (line 80) | def log_metrics(self, dic, prefix=None, step=None, epoch=None):
    method log_parameters (line 92) | def log_parameters(self, parameters, prefix=None, step=None):
    method log_audio (line 103) | def log_audio(self, audio_data, sample_rate=None, file_name=None,
    method log_text (line 131) | def log_text(self, text, step=None, metadata=None):
    method log_histogram (line 143) | def log_histogram(self, values, name=None, step=None, epoch=None,
    method log_histogram_raw (line 164) | def log_histogram_raw(self, tag, summary, step=None):
    method log_curve (line 180) | def log_curve(self, name, x, y, overwrite=False, step=None):
    method log_image_encoded (line 193) | def log_image_encoded(self, encoded_image_string, tag, step=None):
    method log_asset (line 207) | def log_asset(self, file_data, file_name=None, overwrite=False,
    method log_asset_data (line 228) | def log_asset_data(self, data, name=None, overwrite=False, step=None,
    method log_embedding (line 248) | def log_embedding(self, vectors, labels, image_data=None,
    method log_mesh (line 288) | def log_mesh(self, tag, vertices, colors, faces, config_dict, step, wa...
    method log_raw_figure (line 313) | def log_raw_figure(self, tag, asset_type, step=None, **kwargs):
    method log_pr_data (line 326) | def log_pr_data(self, tag, summary, num_thresholds, step=None):
    method log_pr_raw_data (line 355) | def log_pr_raw_data(self, tag, true_positive_counts,

FILE: tensorboardX/crc32c.py
  function crc_update (line 85) | def crc_update(crc, data):
  function crc_finalize (line 108) | def crc_finalize(crc):
  function _crc32c (line 122) | def _crc32c(data):

FILE: tensorboardX/embedding.py
  function maybe_upload_file (line 9) | def maybe_upload_file(local_path):
  function make_tsv (line 36) | def make_tsv(metadata, save_path, metadata_header=None):
  function make_sprite (line 54) | def make_sprite(label_img, save_path):
  function append_pbtxt (line 89) | def append_pbtxt(metadata, label_img, save_path, subdir, global_step, tag):
  function make_mat (line 110) | def make_mat(matlist, save_path):

FILE: tensorboardX/event_file_writer.py
  class EventsWriter (line 29) | class EventsWriter:
    method __init__ (line 32) | def __init__(self, file_prefix, filename_suffix=''):
    method write_event (line 48) | def write_event(self, event):
    method _write_serialized_event (line 57) | def _write_serialized_event(self, event_str):
    method flush (line 62) | def flush(self):
    method close (line 69) | def close(self):
  class EventFileWriter (line 77) | class EventFileWriter:
    method __init__ (line 85) | def __init__(self, logdir, max_queue_size=10, flush_secs=120, filename...
    method get_logdir (line 112) | def get_logdir(self):
    method reopen (line 116) | def reopen(self):
    method add_event (line 129) | def add_event(self, event):
    method flush (line 138) | def flush(self):
    method close (line 147) | def close(self):
  class _EventLoggerThread (line 162) | class _EventLoggerThread(threading.Thread):
    method __init__ (line 165) | def __init__(self, queue, record_writer, flush_secs):
    method stop (line 184) | def stop(self):
    method run (line 188) | def run(self):

FILE: tensorboardX/global_writer.py
  class GlobalSummaryWriter (line 10) | class GlobalSummaryWriter:
    method __init__ (line 22) | def __init__(self, logdir=None, comment='', purge_step=None, max_queue...
    method add_scalar (line 64) | def add_scalar(self, tag, scalar_value, walltime=None):
    method add_image (line 105) | def add_image(self, tag, img_tensor, walltime=None, dataformats='CHW'):
    method add_text (line 152) | def add_text(self, tag, text_string, walltime=None):
    method getSummaryWriter (line 170) | def getSummaryWriter():
    method file_writer (line 198) | def file_writer(self):
    method close (line 201) | def close(self):

FILE: tensorboardX/onnx_graph.py
  function load_onnx_graph (line 8) | def load_onnx_graph(fname):
  function parse (line 15) | def parse(graph):

FILE: tensorboardX/openvino_graph.py
  function load_openvino_graph (line 8) | def load_openvino_graph(fname):

FILE: tensorboardX/record_writer.py
  function register_writer_factory (line 37) | def register_writer_factory(prefix, factory):
  function directory_check (line 43) | def directory_check(path):
  function open_file (line 54) | def open_file(path):
  class S3RecordWriter (line 64) | class S3RecordWriter:
    method __init__ (line 67) | def __init__(self, path):
    method __del__ (line 74) | def __del__(self):
    method bucket_and_path (line 78) | def bucket_and_path(self):
    method write (line 87) | def write(self, val):
    method flush (line 90) | def flush(self):
    method close (line 97) | def close(self):
  class S3RecordWriterFactory (line 102) | class S3RecordWriterFactory:
    method open (line 105) | def open(self, path):
    method directory_check (line 108) | def directory_check(self, path):
  class GCSRecordWriter (line 117) | class GCSRecordWriter:
    method __init__ (line 120) | def __init__(self, path):
    method __del__ (line 133) | def __del__(self):
    method bucket_and_path (line 136) | def bucket_and_path(self):
    method write (line 145) | def write(self, val):
    method flush (line 148) | def flush(self):
    method close (line 157) | def close(self):
  class GCSRecordWriterFactory (line 161) | class GCSRecordWriterFactory:
    method open (line 164) | def open(self, path):
    method directory_check (line 167) | def directory_check(self, path):
  class RecordWriter (line 176) | class RecordWriter:
    method __init__ (line 177) | def __init__(self, path):
    method write (line 184) | def write(self, data):
    method flush (line 192) | def flush(self):
    method close (line 195) | def close(self):
  function masked_crc32c (line 199) | def masked_crc32c(data):
  function u32 (line 204) | def u32(x):
  function make_valid_tf_name (line 208) | def make_valid_tf_name(name):

FILE: tensorboardX/summary.py
  function _clean_tag (line 24) | def _clean_tag(name):
  function _draw_single_box (line 42) | def _draw_single_box(image, xmin, ymin, xmax, ymax, display_str, color='...
  function hparams (line 66) | def hparams(hparam_dict=None, metric_dict=None):
  function scalar (line 144) | def scalar(name, scalar, display_name="", summary_description=""):
  function histogram_raw (line 169) | def histogram_raw(name, min, max, num, sum, sum_squares, bucket_limits, ...
  function histogram (line 199) | def histogram(name, values, bins, max_bins=None):
  function make_histogram (line 221) | def make_histogram(values, bins, max_bins=None):
  function image (line 267) | def image(tag, tensor, rescale=1, dataformats='CHW'):
  function image_boxes (line 299) | def image_boxes(tag, tensor_image, tensor_boxes, rescale=1, dataformats=...
  function draw_boxes (line 314) | def draw_boxes(disp_image, boxes, labels=None):
  function make_image (line 329) | def make_image(tensor, rescale=1, rois=None, labels=None):
  function video (line 356) | def video(tag, tensor, fps=4, dataformats="NTCHW"):
  function make_video (line 369) | def make_video(tensor, fps):
  function audio (line 437) | def audio(tag, tensor, sample_rate=44100):
  function custom_scalars (line 469) | def custom_scalars(layout):
  function text (line 496) | def text(tag, text):
  function pr_curve_raw (line 507) | def pr_curve_raw(tag, tp, fp, tn, fn, precision, recall, num_thresholds=...
  function pr_curve (line 523) | def pr_curve(tag, labels, predictions, num_thresholds=127, weights=None):
  function compute_curve (line 541) | def compute_curve(labels, predictions, num_thresholds=None, weights=None):
  function _get_tensor_summary (line 572) | def _get_tensor_summary(tag, tensor, content_type, json_config):
  function mesh (line 601) | def mesh(tag, vertices, colors, faces, config_dict=None):

FILE: tensorboardX/torchvis.py
  class TorchVis (line 13) | class TorchVis:
    method __init__ (line 14) | def __init__(self, *args, **init_kwargs):
    method register (line 26) | def register(self, *args, **init_kwargs):
    method unregister (line 33) | def unregister(self, *args):
    method __getattr__ (line 39) | def __getattr__(self, attr):
    method __del__ (line 49) | def __del__(self):

FILE: tensorboardX/utils.py
  function figure_to_image (line 2) | def figure_to_image(figures, close=True):
  function graphviz_to_image (line 40) | def graphviz_to_image():
  function _prepare_video (line 44) | def _prepare_video(V):
  function make_grid (line 70) | def make_grid(I, ncols=8):
  function convert_to_NTCHW (line 94) | def convert_to_NTCHW(tensor, input_format):
  function convert_to_HWC (line 106) | def convert_to_HWC(tensor, input_format):  # tensor: numpy array

FILE: tensorboardX/visdom_writer.py
  function _check_connection (line 14) | def _check_connection(fn):
  class VisdomWriter (line 24) | class VisdomWriter:
    method __init__ (line 25) | def __init__(self, *args, **kwargs):
    method _try_connect (line 39) | def _try_connect(self):
    method add_scalar (line 49) | def add_scalar(self, tag, scalar_value, global_step=None, main_tag='de...
    method add_scalars (line 90) | def add_scalars(self, main_tag, tag_scalar_dict, global_step=None):
    method export_scalars_to_json (line 116) | def export_scalars_to_json(self, path):
    method add_histogram (line 128) | def add_histogram(self, tag, values, global_step=None, bins='tensorflo...
    method add_image (line 142) | def add_image(self, tag, img_tensor, global_step=None, caption=None):
    method add_figure (line 159) | def add_figure(self, tag, figure, global_step=None, close=True):
    method add_video (line 173) | def add_video(self, tag, vid_tensor, global_step=None, fps=4):
    method add_audio (line 212) | def add_audio(self, tag, snd_tensor, global_step=None, sample_rate=441...
    method add_text (line 229) | def add_text(self, tag, text_string, global_step=None):
    method add_onnx_graph (line 246) | def add_onnx_graph(self, prototxt):
    method add_graph (line 251) | def add_graph(self, model, input_to_model=None, verbose=False, **kwargs):
    method add_embedding (line 256) | def add_embedding(self, mat, metadata=None, label_img=None, global_ste...
    method add_pr_curve (line 261) | def add_pr_curve(self, tag, labels, predictions, global_step=None, num...
    method add_pr_curve_raw (line 292) | def add_pr_curve_raw(self, tag, true_positive_counts,
    method close (line 324) | def close(self):

FILE: tensorboardX/writer.py
  class DummyFileWriter (line 49) | class DummyFileWriter:
    method __init__ (line 53) | def __init__(self, logdir):
    method get_logdir (line 56) | def get_logdir(self):
    method add_event (line 60) | def add_event(self, event, step=None, walltime=None):
    method add_summary (line 63) | def add_summary(self, summary, global_step=None, walltime=None):
    method add_graph (line 66) | def add_graph(self, graph_profile, walltime=None):
    method add_onnx_graph (line 69) | def add_onnx_graph(self, graph, walltime=None):
    method flush (line 72) | def flush(self):
    method close (line 75) | def close(self):
    method reopen (line 78) | def reopen(self):
    method use_metadata (line 82) | def use_metadata(self, *, global_step=None, walltime=None):
  class FileWriter (line 86) | class FileWriter:
    method __init__ (line 96) | def __init__(self, logdir, max_queue=10, flush_secs=120, filename_suff...
    method get_logdir (line 127) | def get_logdir(self):
    method add_event (line 131) | def add_event(self, event, step=None, walltime=None):
    method add_summary (line 154) | def add_summary(self, summary, global_step=None, walltime=None):
    method add_graph (line 169) | def add_graph(self, graph_profile, walltime=None):
    method add_onnx_graph (line 187) | def add_onnx_graph(self, graph, walltime=None):
    method add_openvino_graph (line 198) | def add_openvino_graph(self, graph, walltime=None):
    method flush (line 209) | def flush(self):
    method close (line 216) | def close(self):
    method reopen (line 222) | def reopen(self):
    method use_metadata (line 231) | def use_metadata(self, *, global_step=None, walltime=None):
  class SummaryWriter (line 253) | class SummaryWriter:
    method __init__ (line 264) | def __init__(
    method __append_to_scalar_dict (line 359) | def __append_to_scalar_dict(self, tag, scalar_value, global_step,
    method _get_file_writer (line 370) | def _get_file_writer(self):
    method _get_comet_logger (line 391) | def _get_comet_logger(self):
    method add_hparams (line 397) | def add_hparams(
    method add_scalar (line 445) | def add_scalar(
    method add_scalars (line 483) | def add_scalars(
    method export_scalars_to_json (line 533) | def export_scalars_to_json(self, path):
    method add_histogram (line 544) | def add_histogram(
    method add_histogram_raw (line 585) | def add_histogram_raw(
    method add_image (line 651) | def add_image(
    method add_images (line 709) | def add_images(
    method add_image_with_boxes (line 772) | def add_image_with_boxes(
    method add_figure (line 812) | def add_figure(
    method add_video (line 835) | def add_video(
    method add_audio (line 864) | def add_audio(
    method add_text (line 888) | def add_text(
    method add_onnx_graph (line 910) | def add_onnx_graph(
    method add_openvino_graph (line 921) | def add_openvino_graph(
    method add_graph (line 932) | def add_graph(
    method _encode (line 953) | def _encode(rawstr):
    method add_embedding (line 961) | def add_embedding(
    method add_pr_curve (line 1044) | def add_pr_curve(
    method add_pr_curve_raw (line 1091) | def add_pr_curve_raw(
    method add_custom_scalars_multilinechart (line 1136) | def add_custom_scalars_multilinechart(
    method add_custom_scalars_marginchart (line 1154) | def add_custom_scalars_marginchart(
    method add_custom_scalars (line 1173) | def add_custom_scalars(
    method add_mesh (line 1196) | def add_mesh(
    method close (line 1239) | def close(self):
    method flush (line 1252) | def flush(self):
    method __enter__ (line 1261) | def __enter__(self):
    method __exit__ (line 1264) | def __exit__(self, exc_type, exc_val, exc_tb):
    method use_metadata (line 1268) | def use_metadata(self, *, global_step=None, walltime=None):

FILE: tensorboardX/x2num.py
  function check_nan (line 10) | def check_nan(array):
  function make_np (line 17) | def make_np(x):
  function prepare_pytorch (line 38) | def prepare_pytorch(x):
  function prepare_theano (line 46) | def prepare_theano(x):
  function prepare_mxnet (line 51) | def prepare_mxnet(x):
  function prepare_chainer (line 56) | def prepare_chainer(x):

FILE: tests/event_file_writer_test.py
  class EventFileWriterTest (line 36) | class EventFileWriterTest(unittest.TestCase):
    method get_temp_dir (line 37) | def get_temp_dir(self):
    method test_event_file_writer_roundtrip (line 41) | def test_event_file_writer_roundtrip(self):
    method test_setting_filename_suffix_works (line 57) | def test_setting_filename_suffix_works(self):
    method test_async_writer_without_write (line 65) | def test_async_writer_without_write(self):
  class AsyncWriterTest (line 78) | class AsyncWriterTest(): #unittest.TestCase):
    method get_temp_dir (line 79) | def get_temp_dir(self):
    method test_async_writer_write_once (line 83) | def test_async_writer_write_once(self):
    method test_async_writer_write_queue_full (line 93) | def test_async_writer_write_queue_full(self):
    method test_async_writer_write_one_slot_queue (line 104) | def test_async_writer_write_one_slot_queue(self):
    method test_async_writer_close_triggers_flush (line 115) | def test_async_writer_close_triggers_flush(self):
    method test_write_after_async_writer_closed (line 124) | def test_write_after_async_writer_closed(self):

FILE: tests/expect_reader.py
  function removeWhiteChar (line 10) | def removeWhiteChar(string):
  function compare_proto (line 14) | def compare_proto(str_to_compare, function_ptr):
  function write_proto (line 48) | def write_proto(str_to_compare, function_ptr):

FILE: tests/record_writer_test.py
  class RecordWriterTest (line 28) | class RecordWriterTest(unittest.TestCase):
    method get_temp_dir (line 29) | def get_temp_dir(self):
    method test_expect_bytes_written (line 33) | def test_expect_bytes_written(self):
    method test_empty_record (line 43) | def test_empty_record(self):
    method test_record_writer_roundtrip (line 53) | def test_record_writer_roundtrip(self):

FILE: tests/test_chainer_np.py
  class ChainerTest (line 23) | class ChainerTest(unittest.TestCase):
    method test_chainer_np (line 24) | def test_chainer_np(self):
    method test_chainer_img (line 33) | def test_chainer_img(self):
    method test_chainer_write (line 39) | def test_chainer_write(self):

FILE: tests/test_crc32c.py
  class CRC32CTest (line 5) | class CRC32CTest(unittest.TestCase):
    method test_crc32c (line 6) | def test_crc32c(self):
    method test_crc32c_python (line 10) | def test_crc32c_python(self):
    method test_crc32c_native (line 14) | def test_crc32c_native(self):

FILE: tests/test_embedding.py
  class EmbeddingTest (line 9) | class EmbeddingTest(unittest.TestCase):
    method test_embedding (line 10) | def test_embedding(self):
    method test_embedding_64 (line 29) | def test_embedding_64(self):
    method test_embedding_square (line 48) | def test_embedding_square(self):
    method test_embedding_fail (line 58) | def test_embedding_fail(self):
    method test_embedding_s3_mock (line 69) | def test_embedding_s3_mock(self):

FILE: tests/test_figure.py
  class FigureTest (line 15) | class FigureTest(unittest.TestCase):
    method test_figure (line 16) | def test_figure(self):
    method test_figure_list (line 35) | def test_figure_list(self):

FILE: tests/test_hparams.py
  function train (line 12) | def train(lr, bsize, n_hidden):
  class HparamsTest (line 17) | class HparamsTest(unittest.TestCase):
    method test_smoke (line 18) | def test_smoke(self):

FILE: tests/test_lint.py
  function test_linting (line 1) | def test_linting():

FILE: tests/test_multiprocess_write.py
  class GlobalWriterTest (line 14) | class GlobalWriterTest(unittest.TestCase):
    method test_flush (line 15) | def test_flush(self):
    method test_flush_timer_is_long_so_data_is_not_there (line 27) | def test_flush_timer_is_long_so_data_is_not_there(self):
    method test_flush_after_close (line 40) | def test_flush_after_close(self):
    method test_auto_close (line 54) | def test_auto_close(self):
    method test_writer (line 57) | def test_writer(self):

FILE: tests/test_numpy.py
  class NumpyTest (line 12) | class NumpyTest(unittest.TestCase):
    method test_scalar (line 13) | def test_scalar(self):
    method test_make_grid (line 26) | def test_make_grid(self):
    method test_numpy_vid (line 29) | def test_numpy_vid(self):
    method test_numpy_vid_uint8 (line 35) | def test_numpy_vid_uint8(self):

FILE: tests/test_onnx_graph.py
  class ONNXGraphTest (line 6) | class ONNXGraphTest(unittest.TestCase):
    method test_onnx_graph (line 7) | def test_onnx_graph(self):

FILE: tests/test_openvino_graph.py
  class OPENVINOGraphTest (line 4) | class OPENVINOGraphTest(unittest.TestCase):
    method test_openvino_graph (line 5) | def test_openvino_graph(self):

FILE: tests/test_pr_curve.py
  class PRCurveTest (line 17) | class PRCurveTest(unittest.TestCase):
    method test_smoke (line 18) | def test_smoke(self):
    method test_pr_purve (line 31) | def test_pr_purve(self):
    method test_pr_purve_raw (line 59) | def test_pr_purve_raw(self):

FILE: tests/test_pytorch_graph.py
  class PytorchGraphTest (line 7) | class PytorchGraphTest(unittest.TestCase):
    method test_pytorch_graph (line 8) | def test_pytorch_graph(self):
    method test_wrong_input_size (line 22) | def test_wrong_input_size(self):

FILE: tests/test_pytorch_np.py
  class PyTorchNumpyTest (line 12) | class PyTorchNumpyTest(unittest.TestCase):
    method test_pytorch_np (line 13) | def test_pytorch_np(self):
    method test_pytorch_write (line 34) | def test_pytorch_write(self):
    method test_pytorch_histogram (line 38) | def test_pytorch_histogram(self):
    method test_pytorch_histogram_raw (line 43) | def test_pytorch_histogram_raw(self):

FILE: tests/test_record_writer.py
  class RecordWriterTest (line 13) | class RecordWriterTest(unittest.TestCase):
    method test_record_writer_s3 (line 15) | def test_record_writer_s3(self):
    method test_make_valid_tf_name (line 26) | def test_make_valid_tf_name(self):
    method test_record_writer_gcs (line 30) | def test_record_writer_gcs(self):

FILE: tests/test_summary.py
  function tensor_N (line 14) | def tensor_N(shape, dtype=float):
  class SummaryTest (line 19) | class SummaryTest(unittest.TestCase):
    method test_uint8_image (line 20) | def test_uint8_image(self):
    method test_float32_image (line 27) | def test_float32_image(self):
    method test_float_1_converts_to_uint8_255 (line 35) | def test_float_1_converts_to_uint8_255(self):
    method test_list_input (line 43) | def test_list_input(self):
    method test_0d_input (line 47) | def test_0d_input(self):
    method test_1d_input (line 51) | def test_1d_input(self):
    method test_empty_input (line 55) | def test_empty_input(self):
    method test_image_with_boxes (line 60) | def test_image_with_boxes(self):
    method test_image_with_one_channel (line 65) | def test_image_with_one_channel(self):
    method test_image_with_four_channel (line 68) | def test_image_with_four_channel(self):
    method test_image_with_one_channel_batched (line 71) | def test_image_with_one_channel_batched(self):
    method test_image_with_3_channel_batched (line 74) | def test_image_with_3_channel_batched(self):
    method test_image_with_four_channel_batched (line 77) | def test_image_with_four_channel_batched(self):
    method test_image_without_channel (line 80) | def test_image_without_channel(self):
    method _iter_gif (line 84) | def _iter_gif(encoded_image):
    method _load_expected_test_video (line 91) | def _load_expected_test_video():
    method assert_grayscale (line 95) | def assert_grayscale(self, image) -> None:
    method test_video (line 101) | def test_video(self):
    method test_audio (line 120) | def test_audio(self):
    method test_text (line 123) | def test_text(self):
    method test_histogram_auto (line 126) | def test_histogram_auto(self):
    method test_histogram_fd (line 129) | def test_histogram_fd(self):
    method test_histogram_doane (line 132) | def test_histogram_doane(self):
    method test_custom_scalars (line 135) | def test_custom_scalars(self):
    method test_mesh (line 141) | def test_mesh(self):
    method test_hparams (line 163) | def test_hparams(self):
    method test_hparams_bool (line 168) | def test_hparams_bool(self):
    method test_hparams_string (line 173) | def test_hparams_string(self):
    method test_hparams_smoke (line 178) | def test_hparams_smoke(self):

FILE: tests/test_summary_writer.py
  class SummaryWriterTest (line 6) | class SummaryWriterTest(unittest.TestCase):
    method test_summary_writer_ctx (line 7) | def test_summary_writer_ctx(self):
    method test_summary_writer_backcompat (line 13) | def test_summary_writer_backcompat(self):
    method test_summary_writer_close (line 18) | def test_summary_writer_close(self):
    method test_windowsPath (line 25) | def test_windowsPath(self):
    method test_pathlib (line 32) | def test_pathlib(self):
    method test_dummy_summary_writer (line 44) | def test_dummy_summary_writer(self):

FILE: tests/test_utils.py
  class UtilsTest (line 8) | class UtilsTest(unittest.TestCase):
    method test_to_HWC (line 9) | def test_to_HWC(self):
    method test_prepare_video (line 21) | def test_prepare_video(self):

FILE: tests/test_visdom.py
  class VisdomTest (line 15) | class VisdomTest(unittest.TestCase):
    method test_TorchVis (line 16) | def test_TorchVis(self):

FILE: tests/test_writer.py
  class WriterTest (line 19) | class WriterTest(unittest.TestCase):
    method test_flush (line 20) | def test_flush(self):
    method test_flush_timer_is_long_so_data_is_not_there (line 32) | def test_flush_timer_is_long_so_data_is_not_there(self):
    method test_flush_after_close (line 45) | def test_flush_after_close(self):
    method test_auto_close (line 58) | def test_auto_close(self):
    method test_reuse_writer_after_closed (line 61) | def test_reuse_writer_after_closed(self):
    method test_writer (line 66) | def test_writer(self):
    method test_writer_with_default_metadata (line 106) | def test_writer_with_default_metadata(self):
Condensed preview — 155 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,111K chars).
[
  {
    "path": ".codecov.yml",
    "chars": 568,
    "preview": "codecov:\n    bot: lanpa\ncoverage:\n  status:\n    project:                   # measuring the overall project coverage\n    "
  },
  {
    "path": ".flake8",
    "chars": 123,
    "preview": "[flake8]\nmax-line-length = 120\nignore = W605,E305,E402,E721,E741,F401,F403,F405,F821,F841,F999\nexclude = tensorboardX/pr"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 734,
    "preview": "---\nname: Bug report\nabout: Create bug report\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature-requests-or-general-questions.md",
    "chars": 135,
    "preview": "---\nname: Feature requests or General questions\nabout: Feature requests or general questions\ntitle: ''\nlabels: ''\nassign"
  },
  {
    "path": ".github/workflows/build-wheel.yml",
    "chars": 2039,
    "preview": "# This workflow will install Python dependencies, run tests and lint with a single version of Python\n# For more informat"
  },
  {
    "path": ".github/workflows/publish-pypi.yml",
    "chars": 2451,
    "preview": "on:\n  workflow_dispatch:\n    inputs:\n      publish_version:\n        required: true\n        type: string\n\njobs:\n  log-the"
  },
  {
    "path": ".github/workflows/test-matrix.yml",
    "chars": 2693,
    "preview": "# This workflow will install Python dependencies, run tests and lint with a single version of Python\n# For more informat"
  },
  {
    "path": ".gitignore",
    "chars": 158,
    "preview": "proto_src/\nprotoc-*.zip\nprotoc/\n__pycache__\ndocs/_*\nbuild\ndist\n*.egg-info\nruns/*\n*.pyc\nmnist\ntensorboardX/_version.py\ns3"
  },
  {
    "path": ".readthedocs.yaml",
    "chars": 1031,
    "preview": "# Read the Docs configuration file for Sphinx projects\n# See https://docs.readthedocs.io/en/stable/config-file/v2.html f"
  },
  {
    "path": "HISTORY.rst",
    "chars": 5268,
    "preview": "History\n=======\n2.6.3 (2025-04-24)\n---------------------\n* Support PaddlePaddle tensors\n* Added a use_metadata context m"
  },
  {
    "path": "LICENSE",
    "chars": 1070,
    "preview": "MIT License\n\nCopyright (c) 2025 Tzu-Wei Huang\n\nPermission is hereby granted, free of charge, to any person obtaining a c"
  },
  {
    "path": "MANIFEST.in",
    "chars": 210,
    "preview": "include HISTORY.rst\ninclude LICENSE\ninclude compile.sh\nrecursive-include tensorboardX/proto *\nrecursive-exclude test *\nr"
  },
  {
    "path": "README.md",
    "chars": 4645,
    "preview": "# tensorboardX\n\n[![PyPI version](https://badge.fury.io/py/tensorboardX.svg)](https://badge.fury.io/py/tensorboardX)\n[![D"
  },
  {
    "path": "compile.sh",
    "chars": 1391,
    "preview": "#!/bin/bash\n\n# Exit on error\n# set -e\n\nDESIRED_PROTO_VERSION=\"22.3\"\n\n# call protoc direclty, if version is not the desir"
  },
  {
    "path": "docs/Makefile",
    "chars": 609,
    "preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHI"
  },
  {
    "path": "docs/conf.py",
    "chars": 5419,
    "preview": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# tensorboardX documentation build configuration file, created by\n# sph"
  },
  {
    "path": "docs/index.rst",
    "chars": 509,
    "preview": ".. tensorboardX documentation master file, created by\n   sphinx-quickstart on Wed Aug  9 01:38:01 2017.\n   You can adapt"
  },
  {
    "path": "docs/requirements.txt",
    "chars": 18,
    "preview": "sphinx-rtd-theme\n\n"
  },
  {
    "path": "docs/tensorboard.rst",
    "chars": 308,
    "preview": "tensorboardX\n===================================\n.. automodule:: tensorboardX\n\n.. autoclass:: SummaryWriter\n    :members"
  },
  {
    "path": "docs/tutorial.rst",
    "chars": 7601,
    "preview": "Tutorials\n*********\n\nWhat is tensorboard X?\n----------------------\n\nAt first, the package was named tensorboard, and soo"
  },
  {
    "path": "docs/tutorial_zh.rst",
    "chars": 4433,
    "preview": "Tutorials_zh\n*************\n\n緣起\n------\nGoogle TensorFlow 附加的工具 Tensorboard 是一個很好用的視覺化工具。他可以記錄數字,影像或者是聲音資訊,對於觀察類神經網路訓練的過程非"
  },
  {
    "path": "docs/utils.rst",
    "chars": 105,
    "preview": "Helper functions\n===================================\n.. autofunction:: tensorboardX.utils.figure_to_image"
  },
  {
    "path": "examples/RUN_AFTER_PIP_INSTALL",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "examples/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "examples/chainer/extension_logger/net.py",
    "chars": 3623,
    "preview": "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport numpy\n\nimport chainer\nfrom chainer import cuda\nimpo"
  },
  {
    "path": "examples/chainer/extension_logger/train_dcgan.py",
    "chars": 4734,
    "preview": "#!/usr/bin/env python\n\nfrom __future__ import print_function\nimport argparse\nimport os\n\nimport chainer\nfrom chainer impo"
  },
  {
    "path": "examples/chainer/extension_logger/updater.py",
    "chars": 1441,
    "preview": "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport chainer\nimport chainer.functions as F\nfrom chainer "
  },
  {
    "path": "examples/chainer/extension_logger/visualize.py",
    "chars": 575,
    "preview": "#!/usr/bin/env python\n\nimport os\n\nimport numpy as np\nfrom PIL import Image\n\nimport chainer\nimport chainer.cuda\nfrom chai"
  },
  {
    "path": "examples/chainer/extension_logger/writetensorboard.py",
    "chars": 5278,
    "preview": "import json\nimport os\nimport shutil\nimport tempfile\n\nimport six\nfrom chainer import reporter\nfrom chainer import seriali"
  },
  {
    "path": "examples/chainer/plain_logger/data.py",
    "chars": 2333,
    "preview": "import gzip\nimport os\n\nimport numpy as np\nimport six\nfrom six.moves.urllib import request\n\nparent = 'http://yann.lecun.c"
  },
  {
    "path": "examples/chainer/plain_logger/net.py",
    "chars": 2048,
    "preview": "import six\n\nimport chainer\nimport chainer.functions as F\nfrom chainer.functions.loss.vae import gaussian_kl_divergence\ni"
  },
  {
    "path": "examples/chainer/plain_logger/train_vae.py",
    "chars": 5697,
    "preview": "#!/usr/bin/env python\n\"\"\"Chainer example: train a VAE on MNIST\n\"\"\"\nfrom __future__ import print_function\nimport argparse"
  },
  {
    "path": "examples/create_wit_samples.py",
    "chars": 2221,
    "preview": "\n\"\"\"\nhttps://archive.ics.uci.edu/ml/datasets/Heart+Disease\n1. #3 (age)\n2. #4 (sex)\n3. #9 (cp)\n4. #10 (trestbps)\n5. #12 ("
  },
  {
    "path": "examples/demo.py",
    "chars": 4207,
    "preview": "import torch\nimport torchvision.utils as vutils\nimport numpy as np\nimport torchvision.models as models\nfrom torchvision "
  },
  {
    "path": "examples/demo_beholder.py",
    "chars": 1783,
    "preview": "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the 'L"
  },
  {
    "path": "examples/demo_comet.py",
    "chars": 4446,
    "preview": "from tensorboardX import SummaryWriter\nimport torch\nimport torchvision.utils as vutils\nimport numpy as np\nimport torchvi"
  },
  {
    "path": "examples/demo_custom_scalars.py",
    "chars": 1529,
    "preview": "from numpy.random import rand\nfrom tensorboardX import SummaryWriter\nimport time\n\n\nwith SummaryWriter() as writer:\n    f"
  },
  {
    "path": "examples/demo_embedding.py",
    "chars": 2909,
    "preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport os\nfrom torch.autograd.variable import Variabl"
  },
  {
    "path": "examples/demo_global_writer.py",
    "chars": 245,
    "preview": "# This program show that you can use summary writer globally\n# So that you can use the writer like the python.logging mo"
  },
  {
    "path": "examples/demo_graph.py",
    "chars": 7683,
    "preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nfrom torch.autograd import Variabl"
  },
  {
    "path": "examples/demo_hogwild.py",
    "chars": 4335,
    "preview": "from __future__ import print_function\nimport argparse\nimport os\nimport torch\nimport torch.optim as optim\nimport torch.nn"
  },
  {
    "path": "examples/demo_hparams.py",
    "chars": 769,
    "preview": "from tensorboardX import SummaryWriter\nimport time\nimport random\n\n\nhparam = {'lr': [0.1, 0.01, 0.001],\n          'bsize'"
  },
  {
    "path": "examples/demo_matplotlib.py",
    "chars": 354,
    "preview": "import matplotlib.pyplot as plt\nplt.switch_backend('agg')\n\nfig = plt.figure()\n\nc1 = plt.Circle((0.2, 0.5), 0.2, color='r"
  },
  {
    "path": "examples/demo_mesh.py",
    "chars": 1274,
    "preview": "import numpy as np\nfrom tensorboardX import SummaryWriter\nfrom numpy.random import randint\n\n\ndef draw_fusilli(turns, rad"
  },
  {
    "path": "examples/demo_multiple_embedding.py",
    "chars": 2311,
    "preview": "import math\nimport numpy as np\nfrom tensorboardX import SummaryWriter\n\n\ndef main():\n    degrees = np.linspace(0, 3600 * "
  },
  {
    "path": "examples/demo_multiprocessing.py",
    "chars": 1070,
    "preview": "from tensorboardX import GlobalSummaryWriter\nimport multiprocessing as mp\nimport time\nimport os\nimport psutil\nimport tor"
  },
  {
    "path": "examples/demo_nvidia_smi.py",
    "chars": 715,
    "preview": "\"\"\"\nwrite gpu and (gpu) memory usage of nvidia cards as scalar\n\"\"\"\nfrom tensorboardX import SummaryWriter\nimport time\nim"
  },
  {
    "path": "examples/demo_onnx.py",
    "chars": 508,
    "preview": "from tensorboardX import SummaryWriter\n\nimport subprocess\nzoo_address = 'https://onnxzoo.blob.core.windows.net/models/op"
  },
  {
    "path": "examples/demo_openvino.py",
    "chars": 286,
    "preview": "from tensorboardX import SummaryWriter\nwith SummaryWriter() as w:\n    # https://download.01.org/opencv/2019/open_model_z"
  },
  {
    "path": "examples/demo_purge.py",
    "chars": 362,
    "preview": "from time import sleep\nfrom tensorboardX import SummaryWriter\n\nwith SummaryWriter(logdir='runs/purge') as w:\n    for i i"
  },
  {
    "path": "examples/global_1.py",
    "chars": 292,
    "preview": "# called by demo_global_writer\n\nfrom tensorboardX import GlobalSummaryWriter\n\nwriter = GlobalSummaryWriter.getSummaryWri"
  },
  {
    "path": "examples/global_2.py",
    "chars": 292,
    "preview": "# called by demo_global_writer\n\nfrom tensorboardX import GlobalSummaryWriter\n\nwriter = GlobalSummaryWriter.getSummaryWri"
  },
  {
    "path": "examples/mobilenetv2.xml",
    "chars": 592370,
    "preview": "<?xml version=\"1.0\" ?>\n<net batch=\"1\" name=\"mobilenetv2-int8-sparse-v1-tf-0001\" version=\"6\">\n\t<layers>\n\t\t<layer id=\"0\" n"
  },
  {
    "path": "examples/processed.cleveland.data",
    "chars": 18461,
    "preview": "63.0,1.0,1.0,145.0,233.0,1.0,2.0,150.0,0.0,2.3,3.0,0.0,6.0,0\n67.0,1.0,4.0,160.0,286.0,0.0,2.0,108.0,1.0,1.5,2.0,3.0,3.0,"
  },
  {
    "path": "pyproject.toml",
    "chars": 2236,
    "preview": "[build-system]\nrequires = [\"setuptools>=42\", \"wheel\", \"setuptools_scm\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[projec"
  },
  {
    "path": "run_pytest.sh",
    "chars": 343,
    "preview": "#!/bin/bash\n\nSCRIPT_DIR=\"$( cd -- \"$( dirname -- \"${BASH_SOURCE[0]}\" )\" &> /dev/null && pwd )\"\n\npip install -r $SCRIPT_D"
  },
  {
    "path": "tensorboardX/__init__.py",
    "chars": 316,
    "preview": "\"\"\"A module for visualization with tensorboard\n\"\"\"\n\nfrom .global_writer import GlobalSummaryWriter\nfrom .record_writer i"
  },
  {
    "path": "tensorboardX/comet_utils.py",
    "chars": 15783,
    "preview": "import functools\nimport json\nimport logging\nfrom io import BytesIO\n\nimport numpy as np\nfrom google.protobuf.json_format "
  },
  {
    "path": "tensorboardX/crc32c.py",
    "chars": 4745,
    "preview": "# https://www.ietf.org/rfc/rfc3309.txt\nimport array\nimport os\n\ntry:\n    if os.environ.get('CRC32C_SW_MODE', None) is Non"
  },
  {
    "path": "tensorboardX/embedding.py",
    "chars": 4679,
    "preview": "import os\nimport sys\n\n# Maximum sprite size allowed by TB frontend,\n# see https://github.com/lanpa/tensorboardX/issues/5"
  },
  {
    "path": "tensorboardX/event_file_writer.py",
    "chars": 8139,
    "preview": "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"L"
  },
  {
    "path": "tensorboardX/global_writer.py",
    "chars": 8506,
    "preview": "import multiprocessing as mp\nfrom multiprocessing import Value\n\nfrom .writer import SummaryWriter\n\nglobal _writer\n_write"
  },
  {
    "path": "tensorboardX/onnx_graph.py",
    "chars": 1666,
    "preview": "from .proto.attr_value_pb2 import AttrValue\nfrom .proto.graph_pb2 import GraphDef\nfrom .proto.node_def_pb2 import NodeDe"
  },
  {
    "path": "tensorboardX/openvino_graph.py",
    "chars": 1142,
    "preview": "from .proto.attr_value_pb2 import AttrValue\nfrom .proto.graph_pb2 import GraphDef\nfrom .proto.node_def_pb2 import NodeDe"
  },
  {
    "path": "tensorboardX/proto/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "tensorboardX/proto/api.proto",
    "chars": 15463,
    "preview": "/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
  },
  {
    "path": "tensorboardX/proto/api_pb2.py",
    "chars": 7761,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/api.prot"
  },
  {
    "path": "tensorboardX/proto/attr_value.proto",
    "chars": 2508,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"AttrValueProtos"
  },
  {
    "path": "tensorboardX/proto/attr_value_pb2.py",
    "chars": 3924,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/attr_val"
  },
  {
    "path": "tensorboardX/proto/event.proto",
    "chars": 2177,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"EventProtos\";\no"
  },
  {
    "path": "tensorboardX/proto/event_pb2.py",
    "chars": 3121,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/event.pr"
  },
  {
    "path": "tensorboardX/proto/graph.proto",
    "chars": 2164,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"GraphProtos\";\no"
  },
  {
    "path": "tensorboardX/proto/graph_pb2.py",
    "chars": 1747,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/graph.pr"
  },
  {
    "path": "tensorboardX/proto/layout.proto",
    "chars": 2864,
    "preview": "/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
  },
  {
    "path": "tensorboardX/proto/layout_pb2.py",
    "chars": 2345,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/layout.p"
  },
  {
    "path": "tensorboardX/proto/node_def.proto",
    "chars": 2569,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"NodeProto\";\nopt"
  },
  {
    "path": "tensorboardX/proto/node_def_pb2.py",
    "chars": 1859,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/node_def"
  },
  {
    "path": "tensorboardX/proto/plugin_hparams.proto",
    "chars": 2892,
    "preview": "/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
  },
  {
    "path": "tensorboardX/proto/plugin_hparams_pb2.py",
    "chars": 2657,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/plugin_h"
  },
  {
    "path": "tensorboardX/proto/plugin_mesh.proto",
    "chars": 716,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX.mesh;\n\n// A MeshPluginData encapsulates information on which plugins are able t"
  },
  {
    "path": "tensorboardX/proto/plugin_mesh_pb2.py",
    "chars": 1570,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/plugin_m"
  },
  {
    "path": "tensorboardX/proto/plugin_pr_curve.proto",
    "chars": 842,
    "preview": "/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
  },
  {
    "path": "tensorboardX/proto/plugin_pr_curve_pb2.py",
    "chars": 1145,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/plugin_p"
  },
  {
    "path": "tensorboardX/proto/plugin_text.proto",
    "chars": 1034,
    "preview": "/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
  },
  {
    "path": "tensorboardX/proto/plugin_text_pb2.py",
    "chars": 1082,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/plugin_t"
  },
  {
    "path": "tensorboardX/proto/resource_handle.proto",
    "chars": 879,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"ResourceHandle\""
  },
  {
    "path": "tensorboardX/proto/resource_handle_pb2.py",
    "chars": 1441,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/resource"
  },
  {
    "path": "tensorboardX/proto/summary.proto",
    "chars": 3920,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"SummaryProtos\";"
  },
  {
    "path": "tensorboardX/proto/summary_pb2.py",
    "chars": 4145,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/summary."
  },
  {
    "path": "tensorboardX/proto/tensor.proto",
    "chars": 2684,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"TensorProtos\";\n"
  },
  {
    "path": "tensorboardX/proto/tensor_pb2.py",
    "chars": 3524,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/tensor.p"
  },
  {
    "path": "tensorboardX/proto/tensor_shape.proto",
    "chars": 1558,
    "preview": "// Protocol buffer representing the shape of tensors.\n\nsyntax = \"proto3\";\noption cc_enable_arenas = true;\noption java_ou"
  },
  {
    "path": "tensorboardX/proto/tensor_shape_pb2.py",
    "chars": 1552,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/tensor_s"
  },
  {
    "path": "tensorboardX/proto/types.proto",
    "chars": 1836,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"TypesProtos\";\no"
  },
  {
    "path": "tensorboardX/proto/types_pb2.py",
    "chars": 2518,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/types.pr"
  },
  {
    "path": "tensorboardX/proto/versions.proto",
    "chars": 956,
    "preview": "syntax = \"proto3\";\n\npackage tensorboardX;\noption cc_enable_arenas = true;\noption java_outer_classname = \"VersionsProtos\""
  },
  {
    "path": "tensorboardX/proto/versions_pb2.py",
    "chars": 1324,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: tensorboardX/proto/versions"
  },
  {
    "path": "tensorboardX/record_writer.py",
    "chars": 5598,
    "preview": "\"\"\"\nTo write tf_record into file. Here we use it for tensorboard's event writting.\nThe code was borrowed from https://gi"
  },
  {
    "path": "tensorboardX/summary.py",
    "chars": 25499,
    "preview": "import logging\nimport os\nimport re as _re\n\nimport numpy as np\n\nfrom .proto import layout_pb2\nfrom .proto.plugin_mesh_pb2"
  },
  {
    "path": "tensorboardX/torchvis.py",
    "chars": 1947,
    "preview": "\nimport gc\nimport time\nfrom functools import wraps\n\nfrom .visdom_writer import VisdomWriter\nfrom .writer import SummaryW"
  },
  {
    "path": "tensorboardX/utils.py",
    "chars": 4477,
    "preview": "# Functions for converting\ndef figure_to_image(figures, close=True):\n    \"\"\"Render matplotlib figure to numpy format.\n\n "
  },
  {
    "path": "tensorboardX/visdom_writer.py",
    "chars": 13227,
    "preview": "import gc\nimport json\nimport math\nimport time\n\nimport numpy as np\n\nfrom .summary import compute_curve\nfrom .utils import"
  },
  {
    "path": "tensorboardX/writer.py",
    "chars": 52350,
    "preview": "\"\"\"Provides an API for writing protocol buffers to event files to be\nconsumed by TensorBoard for visualization.\"\"\"\n\n\nimp"
  },
  {
    "path": "tensorboardX/x2num.py",
    "chars": 1310,
    "preview": "# DO NOT alter/distruct/free input object !\n\nimport logging\n\nimport numpy as np\n\nlogger = logging.getLogger(__name__)\n\n\n"
  },
  {
    "path": "test-requirements.txt",
    "chars": 154,
    "preview": "flake8\npytest\ntorch\ntorchvision\nprotobuf==4.22.3\nnumpy\ntensorboard\nboto3\nmatplotlib\nmoto<5\nsoundfile\nvisdom\nonnx\npytest-"
  },
  {
    "path": "tests/__init__.py",
    "chars": 39,
    "preview": "import torch\nimport tensorboardX.proto\n"
  },
  {
    "path": "tests/event_file_writer_test.py",
    "chars": 4802,
    "preview": "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"L"
  },
  {
    "path": "tests/expect/caffe_mnist.expect",
    "chars": 13618,
    "preview": "node {\n  name: \"conv1/XavierFill\"\n  op: \"XavierFill\"\n  device: \"/gpu:0\"\n  attr {\n    key: \"_output_shapes\"\n    value {\n "
  },
  {
    "path": "tests/expect/caffe_overfeat.expect",
    "chars": 8754,
    "preview": "node {\n  name: \"conv1/XavierFill\"\n  op: \"XavierFill\"\n  device: \"/gpu:0\"\n  attr {\n    key: \"_output_shapes\"\n    value {\n "
  },
  {
    "path": "tests/expect/test_caffe2.test_simple_cnnmodel.expect",
    "chars": 4468,
    "preview": "node {\n  name: \"conv1/XavierFill\"\n  op: \"XavierFill\"\n  attr {\n    key: \"_output_shapes\"\n    value {\n      list {\n       "
  },
  {
    "path": "tests/expect/test_caffe2.test_simple_model.expect",
    "chars": 16527,
    "preview": "node {\n  name: \"conv1/XavierFill\"\n  op: \"XavierFill\"\n  device: \"/cpu:*\"\n  attr {\n    key: \"_output_shapes\"\n    value {\n "
  },
  {
    "path": "tests/expect/test_pr_curve.test_pr_purve.expect",
    "chars": 370,
    "preview": "value {\n  tag: \"tag\"\n  tensor {\n    dtype: DT_FLOAT\n    tensor_shape {\n      dim {\n        size: 6\n      }\n      dim {\n "
  },
  {
    "path": "tests/expect/test_pr_curve.test_pr_purve_raw.expect",
    "chars": 891,
    "preview": "value {\n  tag: \"prcurve with raw data\"\n  tensor {\n    dtype: DT_FLOAT\n    tensor_shape {\n      dim {\n        size: 6\n   "
  },
  {
    "path": "tests/expect/test_summary.test_audio.expect",
    "chars": 617,
    "preview": "value {\n  tag: \"dummy\"\n  audio {\n    sample_rate: 44100.0\n    num_channels: 1\n    length_frames: 42\n    encoded_audio_st"
  },
  {
    "path": "tests/expect/test_summary.test_custom_scalars.expect",
    "chars": 426,
    "preview": "value {\n  tag: \"custom_scalars__config__\"\n  tensor {\n    dtype: DT_STRING\n    tensor_shape {\n    }\n    string_val: \"\\022"
  },
  {
    "path": "tests/expect/test_summary.test_float32_image.expect",
    "chars": 475,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 32\n    width: 32\n    colorspace: 3\n    encoded_image_string: \"\\211PNG\\r\\n\\0"
  },
  {
    "path": "tests/expect/test_summary.test_histogram_auto.expect",
    "chars": 408,
    "preview": "value {\n  tag: \"dummy\"\n  histo {\n    max: 1023.0\n    num: 1024.0\n    sum: 523776.0\n    sum_squares: 357389824.0\n    buck"
  },
  {
    "path": "tests/expect/test_summary.test_histogram_doane.expect",
    "chars": 408,
    "preview": "value {\n  tag: \"dummy\"\n  histo {\n    max: 1023.0\n    num: 1024.0\n    sum: 523776.0\n    sum_squares: 357389824.0\n    buck"
  },
  {
    "path": "tests/expect/test_summary.test_histogram_fd.expect",
    "chars": 408,
    "preview": "value {\n  tag: \"dummy\"\n  histo {\n    max: 1023.0\n    num: 1024.0\n    sum: 523776.0\n    sum_squares: 357389824.0\n    buck"
  },
  {
    "path": "tests/expect/test_summary.test_hparams.expect",
    "chars": 531,
    "preview": "(value {\n  tag: \"_hparams_/experiment\"\n  metadata {\n    plugin_data {\n      plugin_name: \"hparams\"\n      content: \"\\022\\"
  },
  {
    "path": "tests/expect/test_summary.test_hparams_bool.expect",
    "chars": 517,
    "preview": "(value {\n  tag: \"_hparams_/experiment\"\n  metadata {\n    plugin_data {\n      plugin_name: \"hparams\"\n      content: \"\\022\\"
  },
  {
    "path": "tests/expect/test_summary.test_hparams_string.expect",
    "chars": 522,
    "preview": "(value {\n  tag: \"_hparams_/experiment\"\n  metadata {\n    plugin_data {\n      plugin_name: \"hparams\"\n      content: \"\\022\\"
  },
  {
    "path": "tests/expect/test_summary.test_image_with_3_channel_batched.expect",
    "chars": 402,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 8\n    width: 16\n    colorspace: 3\n    encoded_image_string: \"\\211PNG\\r\\n\\03"
  },
  {
    "path": "tests/expect/test_summary.test_image_with_boxes.expect",
    "chars": 602,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 32\n    width: 32\n    colorspace: 3\n    encoded_image_string: \"\\211PNG\\r\\n\\0"
  },
  {
    "path": "tests/expect/test_summary.test_image_with_four_channel.expect",
    "chars": 373,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 8\n    width: 8\n    colorspace: 4\n    encoded_image_string: \"\\211PNG\\r\\n\\032"
  },
  {
    "path": "tests/expect/test_summary.test_image_with_four_channel_batched.expect",
    "chars": 405,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 8\n    width: 16\n    colorspace: 4\n    encoded_image_string: \"\\211PNG\\r\\n\\03"
  },
  {
    "path": "tests/expect/test_summary.test_image_with_one_channel.expect",
    "chars": 344,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 8\n    width: 8\n    colorspace: 3\n    encoded_image_string: \"\\211PNG\\r\\n\\032"
  },
  {
    "path": "tests/expect/test_summary.test_image_with_one_channel_batched.expect",
    "chars": 387,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 8\n    width: 16\n    colorspace: 3\n    encoded_image_string: \"\\211PNG\\r\\n\\03"
  },
  {
    "path": "tests/expect/test_summary.test_image_without_channel.expect",
    "chars": 344,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 8\n    width: 8\n    colorspace: 3\n    encoded_image_string: \"\\211PNG\\r\\n\\032"
  },
  {
    "path": "tests/expect/test_summary.test_mesh.expect",
    "chars": 1693,
    "preview": "value {\n  tag: \"my_mesh_1\"\n  tensor {\n    dtype: DT_FLOAT\n    tensor_shape {\n      dim {\n        size: 1\n      }\n      d"
  },
  {
    "path": "tests/expect/test_summary.test_text.expect",
    "chars": 229,
    "preview": "value {\n  tag: \"dummy/text_summary\"\n  tensor {\n    dtype: DT_STRING\n    tensor_shape {\n      dim {\n        size: 1\n     "
  },
  {
    "path": "tests/expect/test_summary.test_uint8_image.expect",
    "chars": 468,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 32\n    width: 32\n    colorspace: 3\n    encoded_image_string: \"\\211PNG\\r\\n\\0"
  },
  {
    "path": "tests/expect/test_summary.test_video.expect",
    "chars": 5065,
    "preview": "value {\n  tag: \"dummy\"\n  image {\n    height: 16\n    width: 16\n    colorspace: 1\n    encoded_image_string: \"GIF89a\\020\\00"
  },
  {
    "path": "tests/expect_reader.py",
    "chars": 2214,
    "preview": "from __future__ import absolute_import, division, print_function, unicode_literals\nimport importlib\nimport os\nimport sys"
  },
  {
    "path": "tests/record_writer_test.py",
    "chars": 2563,
    "preview": "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"L"
  },
  {
    "path": "tests/test_chainer_np.py",
    "chars": 1424,
    "preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
  },
  {
    "path": "tests/test_crc32c.py",
    "chars": 474,
    "preview": "import unittest\nfrom tensorboardX.crc32c import _crc32c, _crc32c_native, crc32c\n\n\nclass CRC32CTest(unittest.TestCase):\n "
  },
  {
    "path": "tests/test_embedding.py",
    "chars": 3434,
    "preview": "import unittest\nimport torch\nimport boto3\nfrom tensorboardX import SummaryWriter\nfrom moto import mock_s3\n\n\n\nclass Embed"
  },
  {
    "path": "tests/test_figure.py",
    "chars": 1628,
    "preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
  },
  {
    "path": "tests/test_hparams.py",
    "chars": 928,
    "preview": "import unittest\nimport numpy as np\nfrom tensorboardX import SummaryWriter\n\nhparam = {'lr': [0.1, 0.01, 0.001],\n         "
  },
  {
    "path": "tests/test_lint.py",
    "chars": 105,
    "preview": "def test_linting():\n    import subprocess\n    subprocess.check_output(['ruff', 'check', 'tensorboardX'])\n"
  },
  {
    "path": "tests/test_multiprocess_write.py",
    "chars": 3038,
    "preview": "# the file name is intended. pytest don't play well with multiprocessing\n\nfrom tensorboardX import GlobalSummaryWriter a"
  },
  {
    "path": "tests/test_numpy.py",
    "chars": 1341,
    "preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
  },
  {
    "path": "tests/test_onnx_graph.py",
    "chars": 318,
    "preview": "import unittest\nimport torch\nfrom tensorboardX import SummaryWriter\n\n# https://github.com/onnx/models/blob/master/vision"
  },
  {
    "path": "tests/test_openvino_graph.py",
    "chars": 231,
    "preview": "import unittest\nfrom tensorboardX import SummaryWriter\n\nclass OPENVINOGraphTest(unittest.TestCase):\n    def test_openvin"
  },
  {
    "path": "tests/test_pr_curve.py",
    "chars": 3627,
    "preview": "import unittest\nimport torch\nimport numpy as np\nfrom tensorboardX import SummaryWriter\nfrom tensorboardX import summary\n"
  },
  {
    "path": "tests/test_pytorch_graph.py",
    "chars": 956,
    "preview": "from __future__ import absolute_import, division, print_function, unicode_literals\nimport unittest\nimport torch\nfrom ten"
  },
  {
    "path": "tests/test_pytorch_np.py",
    "chars": 2884,
    "preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
  },
  {
    "path": "tests/test_record_writer.py",
    "chars": 1300,
    "preview": "from tensorboardX import SummaryWriter\nimport unittest\nfrom tensorboardX.record_writer import S3RecordWriter, make_valid"
  },
  {
    "path": "tests/test_summary.py",
    "chars": 6740,
    "preview": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport io\nfrom tensorboardX import s"
  },
  {
    "path": "tests/test_summary_writer.py",
    "chars": 1639,
    "preview": "from tensorboardX import SummaryWriter\nimport tempfile\nimport unittest\n\n\nclass SummaryWriterTest(unittest.TestCase):\n   "
  },
  {
    "path": "tests/test_utils.py",
    "chars": 1314,
    "preview": "from tensorboardX import summary\nfrom tensorboardX.utils import make_grid, _prepare_video, convert_to_HWC\nimport numpy a"
  },
  {
    "path": "tests/test_visdom.py",
    "chars": 1309,
    "preview": "from tensorboardX import TorchVis\n\nimport numpy as np\nimport pytest\nimport unittest\n\ntrue_positive_counts = [75, 64, 21,"
  },
  {
    "path": "tests/test_writer.py",
    "chars": 5726,
    "preview": "from tensorboardX import SummaryWriter\nfrom tensorboard.compat.tensorflow_stub.pywrap_tensorflow import PyRecordReader_N"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the lanpa/tensorboardX GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 155 files (1.0 MB), approximately 465.8k tokens, and a symbol index with 406 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!