Skip to content
Closed
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
7 changes: 0 additions & 7 deletions torch/csrc/autograd/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,6 @@ struct TORCH_API Function : std::enable_shared_from_this<Function> {
return sequence_nr_;
}

/// Returns a shared pointer to `this`. `PyFunction`s are not managed by
/// `shared_ptr`s by default, but are bound to the lifetime of their Python
/// object instead.
virtual std::shared_ptr<Function> get_shared_ptr() {
return shared_from_this();
}

/// Returns the name of the dynamic type of the function, for debugging.
virtual std::string name() const;

Expand Down
4 changes: 0 additions & 4 deletions torch/csrc/autograd/python_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,6 @@ auto PyFunction::name() const -> std::string {
return name;
}

auto PyFunction::get_shared_ptr() -> std::shared_ptr<Function> {
return THPFunction_asFunction((THPFunction*)obj);
}

}} // namespace torch::autograd

// Traverse and clear are required for supporting Python's GC cycle handling.
Expand Down
1 change: 0 additions & 1 deletion torch/csrc/autograd/python_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct PyFunction : public Function {

void release_variables() override;
std::string name() const override;
std::shared_ptr<Function> get_shared_ptr() override;
bool is_traceable() override;

// THPFunction this Function is wrapping. Owning!
Expand Down