KEMBAR78
tensor.chunk returns wrong number of chunks · Issue #9382 · pytorch/pytorch · GitHub
Skip to content

tensor.chunk returns wrong number of chunks #9382

@elimohl

Description

@elimohl

Issue description

Number of chunks generated by torch.chunk doesn't match chunks parameter.

Code example

>>> x = torch.arange(0, 11)
>>> x.chunk(5)
(tensor([ 0.,  1.,  2.]),
 tensor([ 3.,  4.,  5.]),
 tensor([ 6.,  7.,  8.]),
 tensor([  9.,  10.]))
>>> len(x.chunk(chunks=5))
4

System Info

PyTorch version: 0.4.0
Is debug build: No
CUDA used to build PyTorch: 8.0.61

OS: Debian GNU/Linux unstable (sid)
GCC version: (Debian 7.3.0-24) 7.3.0
CMake version: version 3.11.2

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.1.85
GPU models and configuration: GPU 0: GeForce GTX 950M
Nvidia driver version: 390.67
cuDNN version: Probably one of the following:
/usr/local/cuda/lib64/libcudnn.so.7.1.4
/usr/local/cuda/lib64/libcudnn_static.a

Versions of relevant libraries:
[pip3] numpy (1.14.5)
[pip3] torch (0.4.0)
[pip3] torchvision (0.2.1)
[conda] Could not collect

pytorch installed by pip3

cc @ezyang @gchanan @zou3519 @mruberry @ssnl

Metadata

Metadata

Assignees

Labels

high prioritymodule: bc-breakingRelated to a BC-breaking changemodule: numpyRelated to numpy support, and also numpy compatibility of our operatorstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions