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.7.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for torchshape-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42dd2ebcdeeb71301f36f57da8660c282f72c2fb754c2ce7e46363be18e9b882 |
|
MD5 | 43302e37509b3268fe4876a5fca24420 |
|
BLAKE2b-256 | ea2e64998895826866b11cf5e9093d9796a8de9a381f9d8da56cb270fb234d5a |