forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code-generate non-aliasing {view}_copy kernels (pytorch#73442)
Summary: Pull Request resolved: pytorch#73442 Test Plan: Imported from OSS Reviewed By: ezyang Differential Revision: D35016025 Pulled By: bdhirsh fbshipit-source-id: 2a7f303ec76f5913b744c7822a531d55a57589c9 (cherry picked from commit 3abe13c)
- Loading branch information
1 parent
dfcb703
commit 23b8414
Showing
13 changed files
with
909 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This yaml file contains all the possible tags that can be defined in `tags` in `native_functions.yaml` | ||
|
||
- tag: inplace_view | ||
desc: | | ||
This tag indicates if an operator *only* modifies the tensor metadata | ||
- tag: view_copy | ||
desc: | | ||
This tag indicates operators that are *_copy* variants | ||
of view/aliasing operators. If an operator has a view_copy tag, | ||
then it should have the name {op}_copy, where {op} is a view operator. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS | ||
// ${generated_comment} | ||
|
||
#include <ATen/Tensor.h> | ||
|
||
#ifndef AT_PER_OPERATOR_HEADERS | ||
#include <ATen/Operators.h> | ||
#else | ||
#include <ATen/ops/clone.h> | ||
$ops_headers | ||
#endif | ||
|
||
namespace at { | ||
namespace native { | ||
|
||
|
||
${CompositeViewCopyKernel_Definitions} | ||
|
||
} // namespace native | ||
} // namespace at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.