diff options
author | Soumith Chintala <soumith@gmail.com> | 2017-01-27 18:19:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-27 18:19:04 +0300 |
commit | 5efb612f312ea8d3996251ab9f45472ea90485c8 (patch) | |
tree | 23c987c475a1ea08a5a207d66b122ff281193490 /doc | |
parent | 479bf761ec38ae686d0a45c45744ca0b35839178 (diff) |
Revert "changed narrow to standardize negative length and negative offset beh…"revert-1113-narrow_edit
Diffstat (limited to 'doc')
-rw-r--r-- | doc/simple.md | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/doc/simple.md b/doc/simple.md index 6b0e4d5..09c60ca 100644 --- a/doc/simple.md +++ b/doc/simple.md @@ -685,45 +685,47 @@ Narrow is application of [narrow](https://github.com/torch/torch7/blob/master/do > x = torch.rand(4, 5) > x - 0.2746 0.8704 0.6839 0.9137 0.5994 - 0.6099 0.6365 0.0923 0.0795 0.4404 - 0.3270 0.9202 0.6142 0.8548 0.8239 - 0.7058 0.6300 0.8553 0.7736 0.3567 + 0.3695 0.2017 0.4485 0.4638 0.0513 + 0.9222 0.1877 0.3388 0.6265 0.5659 + 0.8785 0.7394 0.8265 0.9212 0.0129 + 0.2290 0.7971 0.2113 0.1097 0.3166 [torch.DoubleTensor of size 4x5] > nn.Narrow(1, 2, 3):forward(x) - 0.6099 0.6365 0.0923 0.0795 0.4404 - 0.3270 0.9202 0.6142 0.8548 0.8239 - 0.7058 0.6300 0.8553 0.7736 0.3567 + 0.9222 0.1877 0.3388 0.6265 0.5659 + 0.8785 0.7394 0.8265 0.9212 0.0129 + 0.2290 0.7971 0.2113 0.1097 0.3166 [torch.DoubleTensor of size 3x5] > nn.Narrow(1, 2, -1):forward(x) - 0.6099 0.6365 0.0923 0.0795 0.4404 - 0.3270 0.9202 0.6142 0.8548 0.8239 -[torch.DoubleTensor of size 2x5] + 0.9222 0.1877 0.3388 0.6265 0.5659 + 0.8785 0.7394 0.8265 0.9212 0.0129 + 0.2290 0.7971 0.2113 0.1097 0.3166 +[torch.DoubleTensor of size 3x5] > nn.Narrow(1, 2, 2):forward(x) - 0.6099 0.6365 0.0923 0.0795 0.4404 - 0.3270 0.9202 0.6142 0.8548 0.8239 + 0.9222 0.1877 0.3388 0.6265 0.5659 + 0.8785 0.7394 0.8265 0.9212 0.0129 [torch.DoubleTensor of size 2x5] > nn.Narrow(1, 2, -2):forward(x) - 0.6099 0.6365 0.0923 0.0795 0.4404 -[torch.DoubleTensor of size 1x5] - -> nn.Narrow(2,2,3):forward(x) - 0.8704 0.6839 0.9137 - 0.6365 0.0923 0.0795 - 0.9202 0.6142 0.8548 - 0.6300 0.8553 0.7736 + 0.9222 0.1877 0.3388 0.6265 0.5659 + 0.8785 0.7394 0.8265 0.9212 0.0129 +[torch.DoubleTensor of size 2x5] + +> nn.Narrow(2, 2, 3):forward(x) + 0.2017 0.4485 0.4638 + 0.1877 0.3388 0.6265 + 0.7394 0.8265 0.9212 + 0.7971 0.2113 0.1097 [torch.DoubleTensor of size 4x3] > nn.Narrow(2, 2, -2):forward(x) - 0.8704 0.6839 - 0.6365 0.0923 - 0.9202 0.6142 - 0.6300 0.8553 -[torch.DoubleTensor of size 4x2] + 0.2017 0.4485 0.4638 + 0.1877 0.3388 0.6265 + 0.7394 0.8265 0.9212 + 0.7971 0.2113 0.1097 +[torch.DoubleTensor of size 4x3] ``` <a name="nn.Replicate"></a> |