update aot auto compile path logic

fix doc

fix doc
This commit is contained in:
Zichun Ye 2022-07-12 11:33:27 +08:00
parent 9767a24c6c
commit 92515c18ec
4 changed files with 9 additions and 4 deletions

View File

@ -26,5 +26,5 @@ mindspore.ops.Poisson
**异常:**
- **TypeError** - `seed``seed2` 的数据类型不是 int。
- **TypeError** - `shape` 不是 tuple。
- **TypeError** - `mean` 不是数据类型为 float32 的 Tensor。
- **ValueError** - `shape` 不是常量值。

View File

@ -27,7 +27,7 @@ class Invert(Bijector):
'Invert' + bijector.name.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> import numpy as np

View File

@ -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.

View File

@ -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: