pytorch/docs/source
Mike Ruberry bee174dc3f Adds linalg.det alias, fixes outer alias, updates alias testing (#42802)
Summary:
This PR:

- updates test_op_normalization.py, which verifies that aliases are correctly translated in the JIT
- adds torch.linalg.det as an alias for torch.det
- moves the torch.linalg.outer alias to torch.outer (to be consistent with NumPy)

The torch.linalg.outer alias was put the linalg namespace erroneously as a placeholder since it's a "linear algebra op" according to NumPy but is actually still in the main NumPy namespace.

The updates to test_op_normalization are necessary. Previously it was using method_tests to generate tests, and method_tests assumes test suites using it also use the device generic framework, which test_op_normalization did not. For example, some ops require decorators like `skipCPUIfNoLapack`, which only works in device generic test classes. Moving test_op_normalization to the device generic framework also lets these tests run on CPU and CUDA.

Continued reliance on method_tests() is excessive since the test suite is only interested in testing aliasing, and a simpler and more readable `AliasInfo` class is used for the required information. An example impedance mismatch between method_tests and the new tests, for example, was how to handle ops in namespaces like torch.linalg.det. In the future this information will likely be folded into a common 'OpInfo' registry in the test suite.

The actual tests performed are similar to what they were previously: a scripted and traced version of the op is run and the test verifies that both graphs do not contain the alias name and do contain the aliased name.

The guidance for adding an alias has been updated accordingly.

cc mattip

Note:

ngimel suggests:
- deprecating and then removing the `torch.ger` name
- reviewing the implementation of `torch.outer`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/42802

Reviewed By: zou3519

Differential Revision: D23059883

Pulled By: mruberry

fbshipit-source-id: 11321c2a7fb283a6e7c0d8899849ad7476be42d1
2020-08-11 21:48:31 -07:00
..
_static Improve documentation around builtin functions (#30347) 2019-12-04 13:50:40 -08:00
_templates Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
_templates-stable Add layout.html to template for stable docs (#33770) 2020-03-04 03:14:52 -08:00
community Add MSFT Owners to the Windows Maintainership (#42280) 2020-07-30 08:22:13 -07:00
notes Don't materialize output grads (#41821) 2020-08-11 04:27:07 -07:00
rpc Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
scripts Add torch.nn.GELU for GELU activation (#28944) 2019-11-03 21:55:05 -08:00
__config__.rst Allow a non-OpenMP based build (#19749) 2019-05-06 19:34:48 -07:00
amp.rst Added index_put to promotelist (#41035) 2020-07-07 20:36:55 -07:00
autograd.rst Update docs feature classifications (#39966) 2020-06-24 15:35:59 -07:00
bottleneck.rst
checkpoint.rst
complex_numbers.rst Doc note for complex (#41252) 2020-07-16 08:53:27 -07:00
conf.py restore old documentation references (#39086) 2020-07-09 15:20:10 -07:00
cpp_extension.rst correct some cpp extension code usages and documents (#39766) 2020-06-10 08:31:22 -07:00
cpp_index.rst Add C++ Landing Page (#38450) 2020-05-14 16:02:01 -07:00
cuda.rst Fix most documentation warnings (#27782) 2019-10-13 10:34:01 -07:00
cudnn_persistent_rnn.rst Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
cudnn_rnn_determinism.rst [doc] Add LSTM non-deterministic workaround (#40893) 2020-07-21 16:20:02 -07:00
data.rst add prefetch_factor for multiprocessing prefetching process (#41130) 2020-07-24 08:38:13 -07:00
distributed.rst Add a link in RPC doc page to point to PT Distributed overview (#41108) 2020-07-08 14:00:05 -07:00
distributions.rst Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
dlpack.rst
docutils.conf Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
fft.rst Adds fft namespace (#41911) 2020-08-06 00:20:50 -07:00
futures.rst [JIT x RPC] Consolidate Future type class and Future impl class (#40406) 2020-06-24 01:44:49 -07:00
hub.rst Fix torch.hub.hub_dir inconsistencies (#38969) 2020-05-26 21:06:52 -07:00
index.rst Adds torch.linalg namespace (#42664) 2020-08-07 10:18:30 -07:00
jit_builtin_functions.rst Fix builtin function reference (#24056) 2019-08-09 15:58:15 -07:00
jit_language_reference.rst Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
jit_python_reference.rst [JIT] Add support for with statements (#34705) 2020-06-18 16:57:18 -07:00
jit_unsupported.rst [JIT] Make torch.unique_consecutive compatible (#39339) 2020-06-02 14:54:29 -07:00
jit.rst DOC: fail to build if there are warnings (#41335) 2020-07-28 22:33:44 -07:00
linalg.rst Adds linalg.det alias, fixes outer alias, updates alias testing (#42802) 2020-08-11 21:48:31 -07:00
math-quantizer-equation.png adding quantization.rst file for quantization feature (#27559) 2019-10-09 16:45:09 -07:00
mobile_optimizer.rst optimize_for_mobile: bring packed params to root module (#42740) 2020-08-08 15:53:20 -07:00
model_zoo.rst add/move a few apis in torch.hub (#18758) 2019-04-10 23:10:39 -07:00
multiprocessing.rst Update docs for master to remove Python 2 references (#36336) 2020-04-16 10:15:48 -07:00
name_inference.rst Add arcosh, arcsinh and arctanh to unary ops (#38388) 2020-06-04 11:40:55 -07:00
named_tensor.rst Easier english updated tech docs (#42016) 2020-07-24 14:36:17 -07:00
nn.functional.rst Added SiLU activation function (#41034) 2020-07-10 07:37:30 -07:00
nn.init.rst Bag of documentation fixes; fix more sphinx warnings (#27850) 2019-10-15 07:31:14 -07:00
nn.rst Add Unflatten Module (#41564) 2020-07-21 07:43:02 -07:00
onnx.rst [ONNX] Update pytorch/onnx docs for new export API args (#39802) 2020-06-19 13:38:47 -07:00
optim.rst DOC: fail to build if there are warnings (#41335) 2020-07-28 22:33:44 -07:00
quantization-support.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
quantization.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
random.rst Remove duplicated entries in random.rst (#39725) 2020-06-10 16:51:15 -07:00
rpc.rst [RPC docs] Remove mention of TensorPipe's SHM and CMA backends as they're not built (#41200) 2020-07-09 15:33:07 -07:00
sparse.rst Update docs feature classifications (#39966) 2020-06-24 15:35:59 -07:00
storage.rst
tensor_attributes.rst Update docs feature classifications (#39966) 2020-06-24 15:35:59 -07:00
tensor_view.rst Add torch.movedim (#41480) 2020-07-23 09:41:01 -07:00
tensorboard.rst Add method add_hparams to API doc (#27344) 2019-10-03 17:07:45 -07:00
tensors.rst Adds linalg.det alias, fixes outer alias, updates alias testing (#42802) 2020-08-11 21:48:31 -07:00
torch.nn.intrinsic.qat.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.intrinsic.quantized.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.intrinsic.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.qat.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.quantized.dynamic.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.quantized.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.quantization.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.rst Adds linalg.det alias, fixes outer alias, updates alias testing (#42802) 2020-08-11 21:48:31 -07:00
type_info.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00