ndgnuh / dirtytorch

Stuffs to work with pytorch/pytorchlightning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DIRTYTORCH

Serve as a snippet holder. This module has zero dependencies.

Usage

Command line

List snippets

python -m dirtytorch list
dirty list 
dirty list -f

Dump snippets

dirty dump pl-loggers
dirty dump -o /tmp/loggers.py pl-loggers

Dump snippets from given config

dirty dump -f dirty.json

where dirty.json is:

{
	"pl-loggers": "src/utils/loggers.py",
	"pl-callbacks": "src/utils/callbacks.py"
}

Update dirtytorch

dirty update

Programmatically

from dirtytorch import get_snippet

# Set to False or None to disable writing to files
output_file = "modules_reshape.py"

# The snippet name
snippet = "shape-modules"

# Write snippet to output file
get_snippet(snippet, output_file)

List of snippets

from dirtytorch import list_snippets

list_snippets()

TODO

  • move the dev env to another repo
  • docs for each modules

About

Stuffs to work with pytorch/pytorchlightning

License:MIT License


Languages

Language:Python 89.6%Language:Shell 7.2%Language:Dockerfile 3.2%