diff --git a/aten/src/ATen/core/library.cpp b/aten/src/ATen/core/library.cpp index 7960f22839c..ba608e98ad5 100644 --- a/aten/src/ATen/core/library.cpp +++ b/aten/src/ATen/core/library.cpp @@ -7,7 +7,7 @@ namespace torch { namespace { // TODO: Consider representing debug info as a struct instead so you // don't have to allocate strings all the time - std::string debugString(const std::string& file, uint32_t line) { + std::string debugString(const char* file, uint32_t line) { #ifdef STRIP_ERROR_MESSAGES return std::string(); #else @@ -15,7 +15,7 @@ namespace { #endif } - std::string debugString(std::string debug, const std::string& file, uint32_t line) { + std::string debugString(std::string debug, const char* file, uint32_t line) { #ifdef STRIP_ERROR_MESSAGES return std::string(); #else diff --git a/torch/csrc/utils/python_dispatch.cpp b/torch/csrc/utils/python_dispatch.cpp index eab4d972748..11f0191095e 100644 --- a/torch/csrc/utils/python_dispatch.cpp +++ b/torch/csrc/utils/python_dispatch.cpp @@ -166,7 +166,7 @@ void initDispatchBindings(PyObject* module) { parseKind(kind), std::move(name), std::string(dispatch) == "" ? c10::nullopt : c10::make_optional(c10::parseDispatchKey(dispatch)), - file, + "", // temporary workaround linenum); END_HANDLE_TH_ERRORS_PYBIND }, "", py::arg("kind"), py::arg("name"), py::arg("dispatch"), py::arg("file")="/dev/null", py::arg("linenum")=0) diff --git a/torch/library.h b/torch/library.h index 6cafa7c2958..38887740ecd 100644 --- a/torch/library.h +++ b/torch/library.h @@ -557,7 +557,7 @@ class TORCH_API Library final { Library& operator=(const Library&) = delete; Library(Library&&) = default; Library& operator=(Library&&) = default; - // TODO: add gen_python_error boolean flag + // Some notes about the API design here. We had the following constraints: // // - We need to support multiple "types" of arguments for schema and @@ -802,7 +802,7 @@ class TORCH_API Library final { Kind kind_; c10::optional ns_; c10::optional dispatch_key_; - std::string file_; + const char* file_; uint32_t line_; std::vector registrars_;