/usr/local/lib64/python3.6/site-packages/torch/__pycache__
NameSizeModeActions
autocast_mode.cpython-36.pyc90400644editdlrm
functional.cpython-36.pyc599640644editdlrm
hub.cpython-36.pyc191710644editdlrm
overrides.cpython-36.pyc1243060644editdlrm
quasirandom.cpython-36.pyc67390644editdlrm
random.cpython-36.pyc42710644editdlrm
serialization.cpython-36.pyc285820644editdlrm
storage.cpython-36.pyc83340644editdlrm
torch_version.cpython-36.pyc29650644editdlrm
types.cpython-36.pyc17350644editdlrm
version.cpython-36.pyc2720644editdlrm
_appdirs.cpython-36.pyc220230644editdlrm
_classes.cpython-36.pyc24730644editdlrm
_deploy.cpython-36.pyc22620644editdlrm
_jit_internal.cpython-36.pyc337230644editdlrm
_linalg_utils.cpython-36.pyc28830644editdlrm
_lobpcg.cpython-36.pyc302630644editdlrm
_lowrank.cpython-36.pyc94730644editdlrm
_namedtensor_internals.cpython-36.pyc48560644editdlrm
_ops.cpython-36.pyc41770644editdlrm
_python_dispatcher.cpython-36.pyc34110644editdlrm
_six.cpython-36.pyc10930644editdlrm
_sources.cpython-36.pyc40430644editdlrm
_storage_docs.cpython-36.pyc14360644editdlrm
_tensor.cpython-36.pyc372740644editdlrm
_tensor_docs.cpython-36.pyc1027930644editdlrm
_tensor_str.cpython-36.pyc115320644editdlrm
_torch_docs.cpython-36.pyc3646960644editdlrm
_utils.cpython-36.pyc168940644editdlrm
_utils_internal.cpython-36.pyc13220644editdlrm
_VF.cpython-36.pyc11120644editdlrm
_vmap_internals.cpython-36.pyc112100644editdlrm
__config__.cpython-36.pyc7330644editdlrm
__future__.cpython-36.pyc9840644editdlrm
__init__.cpython-36.pyc244180644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/__pycache__/quasirandom.cpython-36.pyc (6739B)
3 EgA@s(ddlZddlmZGdddeZdS)N)Optionalc@seZdZdZdZdZdddZddejfe e ej ej ej d d d Z dejfe e ej ej ej d d dZddZddZddZddZdS) SobolEnginea The :class:`torch.quasirandom.SobolEngine` is an engine for generating (scrambled) Sobol sequences. Sobol sequences are an example of low discrepancy quasi-random sequences. This implementation of an engine for Sobol sequences is capable of sampling sequences up to a maximum dimension of 21201. It uses direction numbers from https://web.maths.unsw.edu.au/~fkuo/sobol/ obtained using the search criterion D(6) up to the dimension 21201. This is the recommended choice by the authors. References: - Art B. Owen. Scrambling Sobol and Niederreiter-Xing points. Journal of Complexity, 14(4):466-489, December 1998. - I. M. Sobol. The distribution of points in a cube and the accurate evaluation of integrals. Zh. Vychisl. Mat. i Mat. Phys., 7:784-802, 1967. Args: dimension (Int): The dimensionality of the sequence to be drawn scramble (bool, optional): Setting this to ``True`` will produce scrambled Sobol sequences. Scrambling is capable of producing better Sobol sequences. Default: ``False``. seed (Int, optional): This is the seed for the scrambling. The seed of the random number generator is set to this, if specified. Otherwise, it uses a random seed. Default: ``None`` Examples:: >>> soboleng = torch.quasirandom.SobolEngine(dimension=5) >>> soboleng.draw(3) tensor([[0.0000, 0.0000, 0.0000, 0.0000, 0.0000], [0.5000, 0.5000, 0.5000, 0.5000, 0.5000], [0.7500, 0.2500, 0.2500, 0.2500, 0.7500]]) iRFNcCs||jks|dkr$td|jd||_||_||_tjd}tj||j|tj d|_ tj |j |j|jstj|j|tj d|_ n|j |j jtjd|_|jd|jjdd |_d|_dS) Nz9Supported range of dimensionality for SobolEngine is [1, ]cpu)devicedtype)Z memory_formatr)MAXDIM ValueErrorseedscramble dimensiontorchrZzerosMAXBITlong sobolstateZ_sobol_engine_initialize_state_shift _scramblecloneZcontiguous_formatquasiZreshape _first_point num_generated)selfrrrrr=/usr/local/lib64/python3.6/site-packages/torch/quasirandom.py__init__/s zSobolEngine.__init__r)noutr returncCs|jdkr^|dkr |jj|}qtj|j|d|j|j|j|d\}|_tj|j|fdd}n(tj|j||j|j|jd|d\}|_|j|7_|dk r|j |j ||S|S)at Function to draw a sequence of :attr:`n` points from a Sobol sequence. Note that the samples are dependent on the previous samples. The size of the result is :math:`(n, dimension)`. Args: n (Int, optional): The length of sequence of points to draw. Default: 1 out (Tensor, optional): The output tensor dtype (:class:`torch.dtype`, optional): the desired data type of the returned tensor. Default: ``torch.float32`` rr)r r )ZdimN) rrZtorZ_sobol_engine_drawrrrcatZ resize_as_copy_)rrr r resultrrrdrawFs $$zSobolEngine.draw)mr r r!cCsFd|}|j|}||d@dks6tdj|j|||j|||dS)aR Function to draw a sequence of :attr:`2**m` points from a Sobol sequence. Note that the samples are dependent on the previous samples. The size of the result is :math:`(2**m, dimension)`. Args: m (Int): The (base2) exponent of the number of points to draw. out (Tensor, optional): The output tensor dtype (:class:`torch.dtype`, optional): the desired data type of the returned tensor. Default: ``torch.float32`` r rrzThe balance properties of Sobol' points require n to be a power of 2. {0} points have been previously generated, then: n={0}+2**{1}={2}. If you still want to do this, please use 'SobolEngine.draw()' instead.)rr r )rr formatr&)rr'r r rZtotal_nrrr draw_base2js  zSobolEngine.draw_base2cCs|jj|jd|_|S)zF Function to reset the ``SobolEngine`` to base state. r)rr$rr)rrrrresetszSobolEngine.resetcCsZ|jdkr*tj|j|d|j|j|jntj|j||j|j|jd|j|7_|S)a Function to fast-forward the state of the ``SobolEngine`` by :attr:`n` steps. This is equivalent to drawing :attr:`n` samples without using the samples. Args: n (Int): The number of steps to fast-forward by. rr)rrZ_sobol_engine_ff_rrr)rrrrr fast_forwards  zSobolEngine.fast_forwardc Csd}|jdk r"tj}|j|jtjd}tjd|j|jf||d}tj|tj dtj d|j|d|_ |j|j|jf}tjd|||dj }tj |j||jdS)Nrr )r generatorr)r)rr GeneratorZ manual_seedrrandintrrmvpowZarangerZtrilZ_sobol_engine_scramble_r)rgrZ shift_intsZltm_dimsZltmrrrrs   $zSobolEngine._scramblecCsTd|jg}|jr|dg7}|jdk r:|d|jg7}|jjddj|dS)Nz dimension=z scramble=Truezseed=(z, ))rrr __class____name__join)rZ fmt_stringrrr__repr__s   zSobolEngine.__repr__)FN)r5 __module__ __qualname____doc__rr rrZfloat32intrZTensorr r&r)r*r+rr7rrrrrs& $#$r)rtypingrobjectrrrrrs