Calculates the output shape of Pytorch operations
Project description
Torchshape
Calculates the output shape of Pytorch operations
How to use:
-
Install torchshape package:
pip install torchshape
-
Import torchshape package:
from torchshape import tensorshape
-
Call tensorshape function in your code:
outshape = tensorshape(op, inshape)
where op is a torch.nn operation (see the list of supported operations), inshape and outshape are tuples.
See lenet.py for example usage.
List of supported operations
- nn.Conv2d
- nn.Linear
- nn.MaxPool2d
- nn.AvgPool2d
- nn.Flatten
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torchshape-0.0.8.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for torchshape-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4674e411570337ae314d617f5d981805caf176b84e29e5b3a77ce83bcc9d83e7 |
|
MD5 | 6136db39a9db1ef1c22b7db351d6982d |
|
BLAKE2b-256 | bd59c1f933874344922e9ea8cc26918c014b6329d655a49ba5b93522813abfe1 |