A collection of small functions that supplements torch functionality
Project description
TorchFun (originally Torchure)
##for those who expect more convenient features from torch
Functionality
- flatten(tensor)
- imshow(tensor_batch)
- load
Install TorchFun
pip install torchfun
API
Flatten (Module)
used to reshape outputs
Usage:
flat = Flatten()
out = flat(x)
flatten (function)
Usage:
out = flatten(x)
imshow (function)
only deal with torch channel-first image batch,
Arguements:
- x: input data cube, torch tensor or numpy array.
- title: add title to plot. (Default None)
- title can be string, or any string-able object.
- auto_close: (default True)
- Close the pyplot session afterwards.
- Clean the environment just like you had never used matplotlib here.
- if set to False, the plot will remain in the memory for further drawings.
Usage:
imshow(batch) imshow(batch,title=[a,b,c]) imshow(batch,title='title') imshow(batch,auto_close=False)
load (function)
Arguements:
-
arbitrary arguemnts named :
aandbLoad weightainto modelb, or load modelbusing weightaThe order of the arguments doesn't matter. Example:load('weights.pts',model)
or
>load(model,'weights.pts')
or
>f = open('weight.pts')
>load(f,model)
or
>load(model,f)
Return value:
- None
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torchure-0.0.14.tar.gz.
File metadata
- Download URL: torchure-0.0.14.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b03b594fcbe225f734e6b920a2bf8d1778aba40e3736e8209138158753b5ab68
|
|
| MD5 |
2daa09bd1e897d788a2090b06ccf53ca
|
|
| BLAKE2b-256 |
132e59b35ba8bd0bdfd57c8cb445730c1cfa5ed2b76f965836dfb37713907fc1
|
File details
Details for the file torchure-0.0.14-py3-none-any.whl.
File metadata
- Download URL: torchure-0.0.14-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
470532be49d0b0caf95dd037566e4574f16d208f9752f7fb2dcd2fc68ddba5b0
|
|
| MD5 |
fcb2d7ea345d441c5f406830a38f61d8
|
|
| BLAKE2b-256 |
5a7bc956f56f8a6d27a1b7ae43e6f696579e7888018b5f5959620e2aac897b1b
|