mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-11 22:34:53 +08:00
Integrate xdoctest - Rebased (#82797)
This is a new version of #15648 based on the latest master branch. Unlike the previous PR where I fixed a lot of the doctests in addition to integrating xdoctest, I'm going to reduce the scope here. I'm simply going to integrate xdoctest, and then I'm going to mark all of the failing tests as "SKIP". This will let xdoctest run on the dashboards, provide some value, and still let the dashboards pass. I'll leave fixing the doctests themselves to another PR. In my initial commit, I do the bare minimum to get something running with failing dashboards. The few tests that I marked as skip are causing segfaults. Running xdoctest results in 293 failed, 201 passed tests. The next commits will be to disable those tests. (unfortunately I don't have a tool that will insert the `#xdoctest: +SKIP` directive over every failing test, so I'm going to do this mostly manually.) Fixes https://github.com/pytorch/pytorch/issues/71105 @ezyang Pull Request resolved: https://github.com/pytorch/pytorch/pull/82797 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
ba90c9f229
commit
4618371da5
@ -32,6 +32,7 @@ class Multinomial(Distribution):
|
||||
|
||||
Example::
|
||||
|
||||
>>> # xdoctest: +SKIP("FIXME: found invalid values")
|
||||
>>> m = Multinomial(100, torch.tensor([ 1., 1., 1., 1.]))
|
||||
>>> x = m.sample() # equal probability of 0, 1, 2, 3
|
||||
tensor([ 21., 24., 30., 25.])
|
||||
|
||||
Reference in New Issue
Block a user