Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug of block.AbstractInput #105

Merged
merged 2 commits into from
Sep 22, 2022
Merged

Conversation

fangwei123456
Copy link
Contributor

Issue Number:

Objective of pull request:

Pull request checklist

Your PR fulfills the following requirements:

  • Issue created that explains the change and why it's needed
  • Tests are part of the PR (for bug fixes / features)
  • Docs reviewed and added / updated if needed (for bug fixes / features)
  • PR conforms to Coding Conventions
  • PR applys BSD 3-clause or LGPL2.1+ Licenses to all code files
  • Lint (flakeheaven lint src/lava tests/) and (bandit -r src/lava/.) pass locally
  • Build tests (pytest) passes locally

Pull request type

Please check your PR type:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation changes
  • Other (please describe):

What is the current behavior?

Traceback (most recent call last):
  File "/home/wfang/spikingjelly_dev/spikingjelly/test.py", line 6, in <module>
    print(net(torch.rand([1, 2, 3])))
  File "/home/wfang/anaconda3/envs/lava-env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/wfang/anaconda3/envs/lava-env/lib/python3.10/site-packages/lava/lib/dl/slayer/block/base.py", line 94, in forward
    self.input_shape = input.shape[1:-1]
AttributeError: 'builtin_function_or_method' object has no attribute 'shape'

What is the new behavior?

No errors.

Does this introduce a breaking change?

  • Yes
  • No

Supplemental information

Here are the minimal codes to reproduce this error:

import torch
from lava.lib.dl import slayer

net = slayer.block.cuba.Input()
print(net(torch.rand([1, 2, 3])))

Copy link
Contributor

@bamsumit bamsumit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fangwei123456 Thanks for the bugfix :)

@bamsumit bamsumit merged commit fd4a516 into lava-nc:main Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants