Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56830
Opt into formatting on GitHub and format everything. This is a trial run before turning on formatting for more and eventually all of the codebase.
Test Plan: CI
Reviewed By: zertosh
Differential Revision: D27979080
fbshipit-source-id: a80f0c48691c08ae8ca0af06377b87e6a2351151
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50848
I noticed that the call overhead from `Tensor::device()` for ~1-2% of instruction counts depending on the microbenchmark
Some nice looking instruction count wins https://www.internalfb.com/intern/paste/P164529004/
Test Plan: Imported from OSS
Reviewed By: ezyang
Differential Revision: D25984136
Pulled By: bdhirsh
fbshipit-source-id: 0e54f2afe78caeb5a03abbb15e9197556acfeca1
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48728
Mostly removing unnecessary includes so that TensorIterator.h can be
included from NativeFunctions.h without causing cycles. There some
cases where I moved code around so that I didn't have to pull in other
unnecessary stuff.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Test Plan: Imported from OSS
Reviewed By: bhosmer
Differential Revision: D25278030
Pulled By: ezyang
fbshipit-source-id: 5f6b95a6bc734e452e9bd7bee8fe5278f5e45be2
Summary:
function_ref is pulled over from LLVM. It is to callables what StringRef is to strings.
This allows it to be substantially lighter weight, particularly in code size. That comes
at the cost of not being usable in situations where the callable's lifetime is shorter
than the function_ref. This means it is suitable for callback-like scenarios, but not
for situations where the callable needs to be stored. In converting TensorIterator,
I only encountered one situation that required refactoring to comply with function_ref's
constraints.
In my local Release build, this reduces the size of libtorch by 4MB, from 70MB->66MB.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26592
Differential Revision: D17516202
fbshipit-source-id: 267476891f767f4827a4d38149f70e5035c56c48