Skip to content

View tracking for autograd should not save optional std::function #49257

@albanD

Description

@albanD

In the view tracking for autograd in torch/csrc/variable.h, we save the optional view function as an c10::optional<std::function<Variable(const Variable&)>> but the std::function class already has an empty state.

Unless there are performance reasons (see comment #49097 (comment)), the optional can be removed here.

cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved

Metadata

Metadata

Assignees

Labels

better-engineeringRelatively self-contained tasks for better engineering contributorsmodule: autogradRelated to torch.autograd, and the autograd engine in generalsmallWe think this is a small issue to fix. Consider knocking off high priority small issuestriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions