Skip to main content

Calculates the output shape of Pytorch operations

Project description

Torchshape

Calculates the output shape of Pytorch operations

How to use:

  1. Install torchshape package:

    pip install torchshape

  2. Import torchshape package:

    from torchshape import tensorshape

  3. 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)

Uploaded Source

Built Distribution

torchshape-0.0.8-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page