Skip to main content

One line functions for common tasks

Project description

Utilities for simple needs

torch snippets does a lot of default importing for you

Whether it is numpy, pandas, matplotlib or the useful functions that are mentioned below Simply call

from torch_snippets import *

All the imports are lightweight and thus should not take more than a couple of seconds

Auxiliary Functions

There are simple functions that are overloaded to take inputs and perform repetitive tasks that usually take a few lines to write


show, inspect, Glob, read, resize, rotate

Files and Paths

stem, Glob, parent, name, fname,

makedir, zip_files, unzip_file,

find, extn,

readlines, writelines


L, flatten

Dump and load python objects



Tqdm, Timer, randint, Logger


unique, diff, choose, common

Pytorch Modules

Reshape and Permute (nn.Modules)

Report as Pytorch Lightning Callback



Chart from altair

and many more to come...


pip install torch_snippets


%time from torch_snippets import *
CPU times: user 1.79 s, sys: 672 ms, total: 2.46 s
Wall time: 2.62 s

Project details

Release history Release notifications | RSS feed

Download files

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

Source Distribution

torch_snippets-0.499.9.tar.gz (48.9 kB view hashes)

Uploaded source

Built Distribution

torch_snippets-0.499.9-py3-none-any.whl (54.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page