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

github.com/torch/image.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-04-20 21:42:59 +0300
committerSoumith Chintala <soumith@gmail.com>2016-04-20 21:42:59 +0300
commit0680e1fc7b99c0d6aaebc2985aa4df18f082c1b9 (patch)
tree3ea967a332f01bdc2b935253996574ef3d3e88a9
parentecdcfdb315101d7376e8983dc7460c47355d7ef4 (diff)
parent3e5b8b1e1dec6e97b77ddb118270babb78986cb6 (diff)
Merge pull request #161 from lvdmaaten/patch-2
Fix bicubic interpolation when source has size 1
-rwxr-xr-xgeneric/image.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/generic/image.c b/generic/image.c
index 33a5293..0990814 100755
--- a/generic/image.c
+++ b/generic/image.c
@@ -166,6 +166,12 @@ static void image_(Main_scaleCubic_rowcol)(THTensor *Tsrc,
long i;
for( i = 0; i < dst_len; i++ )
dst[ dst_start + i*dst_stride ] = src[ src_start + i*src_stride ];
+ } else if ( src_len == 1 ) {
+ long i;
+ for( i = 0; i < dst_len - 1; i++ ) {
+ long dst_pos = dst_start + i*dst_stride;
+ dst[dst_pos] = src[ src_start ];
+ }
} else {
long di;
float si_f;