Skip to content

Replace view with reshape? #7

@tyler-utah

Description

@tyler-utah

Hi, we were running condensa on the CIFAR-10 and Alexnet example. Our versions are:

Python version: 3.8.5
Pytorch version: 1.12.1+cu102

we get the following error at condensa/util.py line 112

correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one \
dimension spans across two contiguous subspaces). Use .reshape(...) instead.

We tried just replacing view with reshape and things seem to work okay. But I don't know Pytorch enough to know if this is the correct thing to do.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions