Skip to main content

The PyPi package torch_utils changed maintainers

The previous maintainer sfzhou gave the pacakge name to AYO.

Versions 0.X.X are the legacy package published until 2019

All version from 1.0.0 are a totally different project.

Pin you version to the legacy versions if you need it.

torch-utils Build Status codecov PyPI version

Common Utils for PyTorch.

Installation

Need Python 3.6+.

pip install torch-utils

Usage

  1. Accuracy
import torch_utils

# ...

top_1, top_5 = torch_utils.accuracy(output=..., target=..., top_k=(1, 5))
  1. Meter
import torch_utils

loss_meter = torch_utils.AverageMeter(name='Meter', length=10)
loss_meter.update(val=...)

print(loss_meter.avg, loss_meter.val)
print(loss_meter)
#> Test 0.00 (0.00)

progress_meter = torch_utils.ProgressMeter(total_steps=100, total_epochs=10)
progress_meter.update(step=10)
assert progress_meter.step == 10
assert progress_meter.ratio == 0.1
assert progress_meter.epoch == 1
print(progress_meter)
#> Step 10/100=10.0% (1/10)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_utils-0.1.3.tar.gz (7.7 kB view details)

Uploaded Source

File details

Details for the file torch_utils-0.1.3.tar.gz.

File metadata

  • Download URL: torch_utils-0.1.3.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for torch_utils-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c6e62333ee7276f8b09e6a8f89378b7f5ac916ee4ddc131707384707b18b65a6
MD5 b258995be6f1228604bfc2aba5d549d0
BLAKE2b-256 1d9cd578b644a1bc47de785758396e5cadc24342e0fc358b467023c3be3be590

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3 This release

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page