summaryrefslogtreecommitdiff
path: root/aten/tools
diff options
context:
space:
mode:
authorGregory Chanan <gchanan@fb.com>2017-09-20 11:19:23 -0700
committerEdward Z. Yang <ezyang@mit.edu>2017-11-02 19:53:36 -0400
commita10030eec79fa72abea103f9fbf4a0d37105569c (patch)
treef261def95018ef2d2f5a9e9e345109b5a733cc9f /aten/tools
parentc369d4da851e72f8c06d688a984ed54d9a098824 (diff)
downloadpytorch-a10030eec79fa72abea103f9fbf4a0d37105569c.tar.gz
pytorch-a10030eec79fa72abea103f9fbf4a0d37105569c.tar.bz2
pytorch-a10030eec79fa72abea103f9fbf4a0d37105569c.zip
Represent empty tensors as size {0} tensors and fix scalar checks.
This gets rid of kUndefinedDimensions and has nice properties like: - the dimensionality always matches the length of the sizes and strides. - the number of elements is always the product of the sizes (starting at the identity) - the shape you pass to factory functions (e.g. randn) matches the shape that is returned etc. In addition to the empty tensor change, this makes some related changes: 1) expand is now a native function, because it needs to operate on the ATen view of the size/strides. 2) adds tests for a number of functions operating on empty, scalar, non-scalar tensors. This uncovered a number of scalar_check bugs; some of these are fixed in the generated code, some that need to be manually specified can be specified by a 'scalar_check' argument in the cwrap. 3) fixes the formatting of empty tensors 4) changes the THLongStorageView API; the public API was getting overly complicated, so now you call 'makeFromSize', 'makeFromStride', 'makeFromLength' and it just handles the correct mapping for that type.
Diffstat (limited to 'aten/tools')
-rwxr-xr-xaten/tools/run_tests.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/aten/tools/run_tests.sh b/aten/tools/run_tests.sh
index 462dde53a0..aca2a93d7c 100755
--- a/aten/tools/run_tests.sh
+++ b/aten/tools/run_tests.sh
@@ -9,4 +9,5 @@ $BUILD_ROOT/src/ATen/test/broadcast_test
$BUILD_ROOT/src/ATen/test/wrapdim_test
$BUILD_ROOT/src/ATen/test/dlconvertor_test
$BUILD_ROOT/src/ATen/test/native_test
+$BUILD_ROOT/src/ATen/test/scalar_tensor_test
valgrind --suppressions=`dirname $0`/valgrind.sup --error-exitcode=1 $BUILD_ROOT/src/ATen/test/basic -n