Skip to content

Commit

Permalink
Add support for lift_fresh op
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniojkim committed Jul 22, 2022
1 parent 005748b commit 329dc0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions build_tools/autogen_ltc_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ supported:

# ops required for functionalization
- lift
- lift_fresh
# Below are all operators that are "composite" in core,
# but require us to explicitly re-enable functionalization in order to use them.
# Why? These operators are all CompositeExplicitAutograd, which mean that they run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,12 @@ at::Tensor LazyNativeFunctions::lift(const at::Tensor& tensor) {
return at::functionalization::impl::to_functional_tensor(tensor);
}

at::Tensor LazyNativeFunctions::lift_fresh(const at::Tensor& tensor) {
TORCH_INTERNAL_ASSERT(
!at::functionalization::impl::isFunctionalTensor(tensor));
return at::functionalization::impl::to_functional_tensor(tensor);
}

// All of the below ops correspond to CompositeExplicitAutograd kernels from core
// that call into view operators internally.
// These are all composite ops that LTC can technically re-use / get for free,
Expand Down

0 comments on commit 329dc0e

Please sign in to comment.