parent
9767a24c6c
commit
92515c18ec
|
@ -26,5 +26,5 @@ mindspore.ops.Poisson
|
|||
**异常:**
|
||||
|
||||
- **TypeError** - `seed` 或 `seed2` 的数据类型不是 int。
|
||||
- **TypeError** - `shape` 不是 tuple。
|
||||
- **TypeError** - `mean` 不是数据类型为 float32 的 Tensor。
|
||||
- **ValueError** - `shape` 不是常量值。
|
||||
|
|
|
@ -27,7 +27,7 @@ class Invert(Bijector):
|
|||
'Invert' + bijector.name.
|
||||
|
||||
Supported Platforms:
|
||||
``Ascend`` ``GPU``
|
||||
``Ascend`` ``GPU`` ``CPU``
|
||||
|
||||
Examples:
|
||||
>>> import numpy as np
|
||||
|
|
|
@ -51,7 +51,7 @@ class TransformedDistribution(Distribution):
|
|||
please refer to :class:`mindspore.nn.probability.distribution.Distribution`, and examples below.
|
||||
|
||||
Supported Platforms:
|
||||
``Ascend`` ``GPU``
|
||||
``Ascend`` ``GPU`` ``CPU``
|
||||
|
||||
Raises:
|
||||
TypeError: When the input `bijector` is not a Bijector instance.
|
||||
|
|
|
@ -32,6 +32,7 @@ from mindspore.common import dtype as mstype
|
|||
from mindspore.ops import DataType
|
||||
from mindspore import log as logger
|
||||
from mindspore import ops
|
||||
from mindspore.communication.management import get_rank, GlobalComm
|
||||
from ._ms_kernel import determine_variable_usage
|
||||
from ._custom_grad import autodiff_bprop
|
||||
from ._pyfunc_registry import add_pyfunc
|
||||
|
@ -54,7 +55,7 @@ def _get_cache_path():
|
|||
cache_path = cache_path + "/"
|
||||
|
||||
if not os.path.exists(cache_path):
|
||||
os.makedirs(cache_path)
|
||||
os.makedirs(cache_path, exist_ok=True)
|
||||
|
||||
return cache_path
|
||||
|
||||
|
@ -70,6 +71,10 @@ def _compile_aot(file):
|
|||
str, the path to the compiled library.
|
||||
"""
|
||||
cache_path = _get_cache_path()
|
||||
# for distributed case, we create folders separately to avoid conflict
|
||||
if GlobalComm.INITED:
|
||||
cache_path = os.path.join(cache_path, "rank_" + str(get_rank()), "")
|
||||
os.makedirs(cache_path, exist_ok=True)
|
||||
|
||||
search_res = importlib.util.find_spec("mindspore")
|
||||
if search_res is None:
|
||||
|
|
Loading…
Reference in New Issue