Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit b9ce707

Browse files
committed
expose logtostderr flag
1 parent 6f669c0 commit b9ce707

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

tensor_comprehensions/pybinds/pybind_engine.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ namespace py = pybind11;
3939
using ATenCudaCompilationUnit = tc::ATenCompilationUnit<tc::CudaTcExecutor>;
4040

4141
PYBIND11_MODULE(tc, m) {
42+
m.def("set_logtostderr", [](bool logtostderr) {
43+
FLAGS_logtostderr = logtostderr;
44+
});
4245
m.def("set_debug_lang", [](bool debug_lang) {
4346
tc::FLAGS_debug_lang = debug_lang;
4447
});

tensor_comprehensions/tc_unit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from torch.autograd import Variable
2020

2121
from tensor_comprehensions.tc import ATenCompilationUnit
22-
from tensor_comprehensions.tc import set_debug_lang, set_debug_halide, set_debug_tc_mapper, set_debug_cuda, set_debug_tuner, set_dump_cuda
22+
from tensor_comprehensions.tc import set_logtostderr, set_debug_lang, set_debug_halide, set_debug_tc_mapper, set_debug_cuda, set_debug_tuner, set_dump_cuda
2323
from tensor_comprehensions.torch_tc.tc_function import TCFunction, unpack_variables, get_tensors, make_contiguous
2424
from tensor_comprehensions.autotuner import ATenAutotuner
2525
from tensor_comprehensions.mapping_options import Options
@@ -49,6 +49,7 @@ def set_gflags(
4949
self, debug_lang=False, debug_halide=False, debug_tc_mapper=False,
5050
debug_cuda=False, debug_tuner=False, dump_cuda=False, **kwargs
5151
):
52+
set_logtostderr(True)
5253
set_debug_lang(debug_lang)
5354
set_debug_halide(debug_halide)
5455
set_debug_tc_mapper(debug_tc_mapper)

test_python/layers/test_dump_cuda.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import tensor_comprehensions as tc
1717

1818
import torch
19-
import torch.cuda
2019
import unittest
2120

2221
# enable this to dump cuda code generated whenever tc layer runs: simple run or

0 commit comments

Comments
 (0)