| commit | 13a041284ceec7cca934c3b1cf74617be1f1e45e | [log] [tgz] |
|---|---|---|
| author | jokeren <robinho364@gmail.com> | Tue Jan 31 22:58:42 2017 +0800 |
| committer | Soumith Chintala <soumith@gmail.com> | Thu Feb 23 06:01:13 2017 -0500 |
| tree | a9faf6abc496ef3adce76d17f2c11a14481fafb9 | |
| parent | c60c1a003d32244a4a5f2a800a10f81973feb802 [diff] |
THTensorApply2 copy optimization
diff --git a/generic/THTensorCopy.c b/generic/THTensorCopy.c index 5dfdcf1..cc92c33 100644 --- a/generic/THTensorCopy.c +++ b/generic/THTensorCopy.c
@@ -15,6 +15,8 @@ for (i=0; i<sz; ++i) rp[i] = sp[i]; #endif + } else if (THTensor_(isContiguous)(tensor) || THTensor_(isContiguous)(src)) { + TH_TENSOR_APPLY2_CONTIGUOUS(real, tensor, real, src, *tensor_data = *src_data;) } else { TH_TENSOR_APPLY2(real, tensor, real, src, *tensor_data = *src_data;) }