Skip to content

Commit

Permalink
Python lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gussmith23 committed Apr 20, 2019
1 parent dabbad5 commit 73e94a9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/dlpack
2 changes: 1 addition & 1 deletion 3rdparty/dmlc-core
Submodule dmlc-core updated 67 files
+0 −7 .travis.yml
+33 −63 CMakeLists.txt
+1 −6 Makefile
+11 −72 appveyor.yml
+2 −15 cmake/build_config.h.in
+0 −5 cmake/dmlc-config.cmake.in
+0 −16 doc/build.md
+0 −1 doc/index.md
+1 −57 include/dmlc/any.h
+17 −3 include/dmlc/base.h
+2 −20 include/dmlc/build_config.h
+0 −1 include/dmlc/common.h
+0 −1 include/dmlc/concurrency.h
+1 −1 include/dmlc/data.h
+5 −23 include/dmlc/endian.h
+31 −2 include/dmlc/filesystem.h
+1 −114 include/dmlc/io.h
+2 −3 include/dmlc/json.h
+21 −28 include/dmlc/logging.h
+0 −2 include/dmlc/memory.h
+1 −1 include/dmlc/optional.h
+6 −26 include/dmlc/parameter.h
+2 −6 include/dmlc/registry.h
+0 −737 include/dmlc/strtonum.h
+0 −2 include/dmlc/thread_group.h
+15 −19 include/dmlc/threadediter.h
+0 −3 make/config.mk
+1 −1 scripts/lint.py
+8 −0 scripts/travis/travis_osx_install.sh
+2 −2 src/build_config.cc
+1 −1 src/data/csv_parser.h
+1 −1 src/data/libfm_parser.h
+1 −1 src/data/libsvm_parser.h
+312 −0 src/data/strtonum.h
+17 −21 src/data/text_parser.h
+1 −0 src/io.cc
+1 −1 src/io/azure_filesys.h
+2 −32 src/io/filesys.cc
+128 −0 src/io/filesys.h
+1 −2 src/io/hdfs_filesys.h
+0 −3 src/io/indexed_recordio_split.h
+6 −20 src/io/input_split_base.cc
+1 −7 src/io/input_split_base.h
+0 −3 src/io/line_split.h
+24 −37 src/io/local_filesys.cc
+1 −1 src/io/local_filesys.h
+0 −3 src/io/recordio_split.h
+2 −4 src/io/s3_filesys.cc
+1 −1 src/io/s3_filesys.h
+1 −8 src/io/single_file_split.h
+1 −0 src/io/uri_spec.h
+1 −1 test/dmlc_test.mk
+1 −1 test/filesys_test.cc
+7 −8 test/strtonum_test.cc
+0 −1 test/unittest/.gitignore
+10 −58 test/unittest/CMakeLists.txt
+0 −1 test/unittest/build_config.h.in
+ test/unittest/sample.rec
+2 −52 test/unittest/unittest_inputsplit.cc
+1 −1 test/unittest/unittest_lockfree.cc
+2 −1 test/unittest/unittest_logging.cc
+12 −150 test/unittest/unittest_param.cc
+2 −2 test/unittest/unittest_parser.cc
+5 −24 test/unittest/unittest_thread_group.cc
+6 −13 tracker/dmlc_tracker/local.py
+0 −2 tracker/dmlc_tracker/opts.py
+2 −2 tracker/dmlc_tracker/tracker.py
2 changes: 1 addition & 1 deletion python/tvm/_ffi/ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def asnumpy(self):
return np_arr

def copybytesto(self, target):
assert(target.flags['C_CONTIGUOUS'])
assert target.flags['C_CONTIGUOUS']
data = target.ctypes.data_as(ctypes.c_void_p)
nbytes = ctypes.c_size_t(target.size * target.dtype.itemsize)
_LIB.TVMArrayCopyToBytes(self.handle, data, nbytes)
Expand Down
9 changes: 4 additions & 5 deletions python/tvm/custom_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def register_op(lower_func, op_name, target, type_name, src_type_name=None):
the argument to the Cast. If op_name is not "Cast", this is unused.
"""

if op_name is "Cast":
if op_name == "Cast":
assert src_type_name is not None
lower_func_name = "tvm.custom_datatypes.lower." + target + "." \
+ op_name + "." + type_name + "." + src_type_name
Expand Down Expand Up @@ -81,11 +81,10 @@ def lower(op):
dtype = "uint" + str(t.bits)
if t.lanes > 1:
dtype += "x" + str(t.lanes)
if type(op) is _Cast:
if isinstance(op, _Cast):
return _make.Call(dtype, extern_func_name, convert([op.value]),
_Call.Extern, None, 0)
else:
return _make.Call(dtype, extern_func_name, convert([op.a, op.b]),
_Call.Extern, None, 0)
return _make.Call(dtype, extern_func_name, convert([op.a, op.b]),
_Call.Extern, None, 0)

return lower

0 comments on commit 73e94a9

Please sign in to comment.