Skip to content

Commit 2df4b9b

Browse files
committed
Fix bug in metamethods
1 parent 5c126af commit 2df4b9b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

.THCTensor.cu.swp

12 KB
Binary file not shown.

THCTensor.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,9 @@ int THCudaTensor_checkGPU(THCState *state, unsigned int nTensors, ...)
766766
int valid = 1;
767767
for (unsigned int i = 0; i < nTensors; i++) {
768768
THCudaTensor* tensor = va_arg(args, THCudaTensor*);
769+
if (tensor == NULL) {
770+
continue;
771+
}
769772
int tensorDev = THCudaTensor_getDevice(state, tensor);
770773
if (tensorDev != -1 && tensorDev != curDev) {
771774
valid = 0;

0 commit comments

Comments
 (0)