Skip to content

Commit e1724d6

Browse files
author
muzhuo.yj
committed
Small code refine to avoid unnecessary object copy overhead.
1 parent 3da4947 commit e1724d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/compiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
namespace trtorch {
2525
namespace core {
2626

27-
c10::FunctionSchema GenerateGraphSchema(torch::jit::script::Module mod, std::string method_name, std::shared_ptr<torch::jit::Graph>& g) {
27+
c10::FunctionSchema GenerateGraphSchema(torch::jit::script::Module mod, const std::string& method_name, std::shared_ptr<torch::jit::Graph>& g) {
2828

2929
std::vector<c10::Argument> args;
3030
for (auto in : g->inputs()) {
@@ -65,7 +65,7 @@ void AddEngineToGraph(torch::jit::script::Module mod, std::shared_ptr<torch::jit
6565
}
6666

6767
std::string ConvertGraphToTRTEngine(const torch::jit::script::Module& mod,
68-
std::string method_name,
68+
const std::string& method_name,
6969
conversion::ExtraInfo cfg) {
7070
auto g = mod.get_method(method_name).graph();
7171
// Go through PyTorch Lowering to simplify graph and extract weight parameters

0 commit comments

Comments
 (0)