Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRudy Bunel <bunel.rudy@gmail.com>2017-09-07 15:58:06 +0300
committerSoumith Chintala <soumith@gmail.com>2017-09-07 20:22:20 +0300
commit76a65293437cdac53497180aa8b89a057cc73b6a (patch)
tree76ba8584167588e2a106a22223248738a36d6b61
parent75a86469aa9e2f5f04e11895b269ec22eb0e4687 (diff)
Adjust error message for View
When the size given is incorrect for the number of elements, the current error message is: `size '[1 x 1 x 5]' is invalid for input of with 1 elements at /pytorch/torch/lib/TH/THStorage.c:41` This replaces it by `size '[1 x 1 x 5]' is invalid for input with 1 elements at /pytorch/torch/lib/TH/THStorage.c:41` which is grammatically better
-rw-r--r--lib/TH/THStorage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/TH/THStorage.c b/lib/TH/THStorage.c
index e57181c..9f86eb6 100644
--- a/lib/TH/THStorage.c
+++ b/lib/TH/THStorage.c
@@ -34,11 +34,11 @@ THLongStorage *THLongStorage_newInferSize(THLongStorage *size, ptrdiff_t nElemen
if (dim_infer != -1) {
THDescBuff buf = THLongStorage_sizeDesc(size);
THArgCheck(total_size > 0 && nElement % total_size == 0, 2,
- "size '%s' is invalid for input of with %td elements", buf.str, nElement);
+ "size '%s' is invalid for input with %td elements", buf.str, nElement);
} else {
THDescBuff buf = THLongStorage_sizeDesc(size);
THArgCheck(nElement == total_size, 2,
- "size '%s' is invalid for input of with %td elements", buf.str, nElement);
+ "size '%s' is invalid for input with %td elements", buf.str, nElement);
}
THLongStorage* copy = THLongStorage_newWithSize(size->size);
THLongStorage_copy(copy, size);