Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions torch_xla/csrc/xla_graph_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ XLAGraphExecutor::ComputationCache* CreateComputationCache() {

} // namespace

XLAGraphExecutor::~XLAGraphExecutor() {
computation_cache_->Clear();
delete computation_cache_;
}

auto XLAGraphExecutor::DeviceContextArena::Get() -> DeviceContextArena* {
static DeviceContextArena* arena = new DeviceContextArena();
return arena;
Expand Down
2 changes: 2 additions & 0 deletions torch_xla/csrc/xla_graph_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ namespace torch_xla {

class XLAGraphExecutor : public torch::lazy::LazyGraphExecutor {
public:
~XLAGraphExecutor();

static XLAGraphExecutor* Get();

// Override to use our own DeviceContextArena.
Expand Down
Loading