Skip to content

Move tensor methods out from XLATensor#4260

Merged
alanwaketan merged 9 commits intomasterfrom
alanwaketan/tensor_methods
Dec 2, 2022
Merged

Move tensor methods out from XLATensor#4260
alanwaketan merged 9 commits intomasterfrom
alanwaketan/tensor_methods

Conversation

@alanwaketan
Copy link
Copy Markdown
Collaborator

Summary:
This is to simplify the interfaces in XLATensor and match what upstream does. Keeping the code base similar will be easier for us to maintain both at the same time.

A few thing to notice:

  1. All tensor methods are now under namespace tensor_methods. The reason to have a distinct namespace is to distinguish from the XLANativeFunctions ones that share the same name.
  2. Also some methods and data structures in XLATensor are moved from private to public such that tensor methods can still access them, including struct Data, CreateFrom(), SetIrValue(), SetInPlaceIrValue(), MakeOutputTensors(), SetSubView(), ModifyCurrentView(), CreateViewTensor(), CopyTensorToDevice() and data().
  3. DispatchComparisonOp is moved to the anonymous namespace within tensor_methods.cpp, and becomes proper helpers.

Test Plan:
CI.

@alanwaketan alanwaketan added the tracing Lazy Tensor tracing label Dec 1, 2022
@alanwaketan alanwaketan self-assigned this Dec 1, 2022
@alanwaketan alanwaketan force-pushed the alanwaketan/tensor_methods branch from 199c0d4 to 3c91a4b Compare December 1, 2022 21:34
Copy link
Copy Markdown
Collaborator

@wonjoo-wj wonjoo-wj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM pending CI. I guess we should eventually update our codegen/op-lowering guides to reflect this. Maybe I can quickly update those as part of the fixit week 😄

@alanwaketan
Copy link
Copy Markdown
Collaborator Author

Thanks Wonjoo for approving the change. And good catch on the guides. That will be a fantastic fixit task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tracing Lazy Tensor tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants