Skip to content

Commit

Permalink
Remove unused TensorRT code (apache#12147)
Browse files Browse the repository at this point in the history
Removing some python code that isn't in the current TensorRT execution paths.
This should make the code more readable and avoid potential linting errors.

Thanks to @vandanavk for pointing out the dead code and @cclauss for a quick
alternative fix.

Co-authored-by: Vandana Kannan <vandanavk@users.noreply.github.com>
Co-authored-by: cclauss <cclauss@bluewin.ch>
  • Loading branch information
3 people authored and leezu committed Aug 16, 2018
1 parent 9933d7a commit dbad76f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
16 changes: 0 additions & 16 deletions python/mxnet/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,19 +729,3 @@ def write_all_str(module_file, module_all_list):
module_op_file.close()
write_all_str(module_internal_file, module_internal_all)
module_internal_file.close()

def cint(init_val=0):
"""create a C int with an optional initial value"""
return C.c_int(init_val)

def int_addr(x):
"""given a c_int, return it's address as an int ptr"""
x_addr = C.addressof(x)
int_p = C.POINTER(C.c_int)
x_int_addr = C.cast(x_addr, int_p)
return x_int_addr

def checked_call(f, *args):
"""call a cuda function and check for success"""
error_t = f(*args)
assert error_t == 0, "Failing cuda call %s returns %s." % (f.__name__, error_t)
9 changes: 0 additions & 9 deletions tests/python/tensorrt/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.

import os
from ctypes.util import find_library


Expand All @@ -29,11 +28,3 @@ def merge_dicts(*dict_args):
for dictionary in dict_args:
result.update(dictionary)
return result


def get_fp16_infer_for_fp16_graph():
return int(os.environ.get("MXNET_TENSORRT_USE_FP16_FOR_FP32", 0))


def set_fp16_infer_for_fp16_graph(status=False):
os.environ["MXNET_TENSORRT_USE_FP16_FOR_FP32"] = str(int(status))

0 comments on commit dbad76f

Please sign in to comment.