mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Add SourceView
which doesn't own source text as base class of Source
(#65309)
Summary: This would save the cost copying text from stack to heap in some cases (like parsing function schema during loading phase of libtorch.so) Pull Request resolved: https://github.com/pytorch/pytorch/pull/65309 Reviewed By: swolchok Differential Revision: D31060315 Pulled By: gmagogsfm fbshipit-source-id: 0caf7a688b40df52bb4388c5191d1a42351d6f1a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bff64e84cd
commit
147f7559b1
@ -18,12 +18,12 @@ def one(self, x: Tensor, y: Tensor) -> Tensor:
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
return x
|
||||
)JIT"};
|
||||
static const auto parentForward = R"JIT(
|
||||
static const std::string parentForward = R"JIT(
|
||||
def forward(self, x: Tensor) -> Tensor:
|
||||
return self.subMod.forward(x)
|
||||
)JIT";
|
||||
|
||||
static const auto moduleInterfaceSrc = R"JIT(
|
||||
static constexpr c10::string_view moduleInterfaceSrc = R"JIT(
|
||||
class OneForward(ModuleInterface):
|
||||
def one(self, x: Tensor, y: Tensor) -> Tensor:
|
||||
pass
|
||||
|
Reference in New Issue
Block a user