commit
a154da782a
|
@ -53,15 +53,15 @@ mindspore.rewrite
|
|||
异常:
|
||||
- **TypeError** - 参数 `network` 不是Cell类型对象。
|
||||
|
||||
.. py:method:: mindspore.rewrite.SymbolTree.create_call_function(self, func, targets, args, kwargs)
|
||||
.. py:method:: mindspore.rewrite.SymbolTree.create_call_function(func, targets, args, kwargs)
|
||||
|
||||
创建一个Node对象,并生成执行代码插入源码中。源码中以 `args` 和 `kwargs` 为参数调用 `func` 函数。
|
||||
|
||||
参数:
|
||||
- **func** (FunctionType) - 要被调用的函数。
|
||||
- **targets** (list[str]) - 表示输出名称。在源代码中作为节点的输出。
|
||||
- **targets** (list[str]) - 表示输出名称。在源代码中作为节点的输出。
|
||||
- **args** (Union[MsDtypes, ParamTypes]) - 该节点的参数名称。用作源代码中代码语句的参数。默认为None表示 `cell` 没有参数输入。
|
||||
- **kwargs** ({str: Union[MsDtypes, ParamTypes]}) - 键的类型必须是str,值必须是MsDtypes或类型必须是ParamTypes。用来说明带有关键字的形参的输入参数名称。输入名称在源代码中作为语句表达式中的 `kwargs`。默认为None,表示没有 `kwargs` 输入。
|
||||
- **kwargs** (dict{str,Union[MsDtypes, ParamTypes]}) - 键的类型必须是str,值必须是MsDtypes或类型必须是ParamTypes。用来说明带有关键字的形参的输入参数名称。输入名称在源代码中作为语句表达式中的 `kwargs`。默认为None,表示没有 `kwargs` 输入。
|
||||
|
||||
返回:
|
||||
一个Node实例。
|
||||
|
|
|
@ -3794,7 +3794,7 @@ class SBDataset(GeneratorDataset):
|
|||
|
||||
- The tensor of column :py:obj:`image` is of the uint8 type.
|
||||
- The tensor of column :py:obj:`task` contains 20 images of the uint8 type if `task` is 'Boundaries' otherwise
|
||||
contains 1 image of the uint8 type.
|
||||
contains 1 image of the uint8 type.
|
||||
|
||||
Args:
|
||||
dataset_dir (str): Path to the root directory that contains the dataset.
|
||||
|
|
|
@ -112,8 +112,8 @@ class MaxPool3d(Cell):
|
|||
|
||||
Inputs:
|
||||
- **x** (Tensor) - Tensor of shape :math:`(N_{in}, C_{in}, D_{in}, H_{in}, W_{in})` or
|
||||
:math:`(C_{in}, D_{in}, H_{in}, W_{in})` with data type of int8, int16, int32,
|
||||
int64, uint8, uint16, uint32, uint64, float16, float32 or float64.
|
||||
:math:`(C_{in}, D_{in}, H_{in}, W_{in})` with data type of int8, int16, int32,
|
||||
int64, uint8, uint16, uint32, uint64, float16, float32 or float64.
|
||||
|
||||
Outputs:
|
||||
If `return_indices` is False, output is a Tensor, with shape :math:`(N, C, D_{out}, H_{out}, W_{out})`, or
|
||||
|
|
|
@ -2263,7 +2263,7 @@ class GaussianNLLLoss(LossBase):
|
|||
full (bool): Include the constant term in the loss calculation. When :math:`full=True`, the constant term
|
||||
`const.` will be :math:`0.5 * log(2\pi)`. Default: False.
|
||||
eps (float): Used to improve the stability of log function. Default: 1e-6.
|
||||
reduction (string): Apply specific reduction method to the output: 'none', 'mean', or 'sum'. Default: 'mean'.
|
||||
reduction (str): Apply specific reduction method to the output: 'none', 'mean', or 'sum'. Default: 'mean'.
|
||||
|
||||
Inputs:
|
||||
- **logits** (Tensor) - Tensor of shape :math:`(N, *)` or :math:`(*)` where :math:`*` means any number of
|
||||
|
|
|
@ -158,9 +158,9 @@ def reverse(x, axis):
|
|||
The value range of "axis" is [-dims, dims - 1]. "dims" is the dimension length of "input_x".
|
||||
|
||||
Args:
|
||||
- **x** (Tensor) - The target tensor. The data type is Number except float64.
|
||||
The shape is :math:`(N,*)` where :math:`*` means, any number of additional dimensions.
|
||||
- **axis** (Union[tuple(int), list(int)]): The indices of the dimensions to reverse.
|
||||
x (Tensor): The target tensor. The data type is Number except float64.
|
||||
The shape is :math:`(N,*)` where :math:`*` means, any number of additional dimensions.
|
||||
axis (Union[tuple(int), list(int)]): The indices of the dimensions to reverse.
|
||||
|
||||
Outputs:
|
||||
Tensor, has the same shape and type as `x`.
|
||||
|
|
|
@ -58,7 +58,7 @@ def _environment_check():
|
|||
|
||||
|
||||
class Profiler:
|
||||
"""
|
||||
r"""
|
||||
This class to enable the profiling of MindSpore neural networks.
|
||||
MindSpore users can import the mindspore.Profiler, initialize the Profiler object to start profiling,
|
||||
and use Profiler.analyse() to stop profiling and analyse the results.
|
||||
|
@ -85,7 +85,7 @@ class Profiler:
|
|||
- 2: Memory contains ub_read/write_bw, l1_read/write_bw, l2_read/write_bw, main_mem_read/write_bw etc.
|
||||
- 3: MemoryL0 contains l0a_read/write_bw, l0b_read/write_bw, l0c_read/write_bw etc.
|
||||
- 4: ResourceConflictRatio contains vec_bankgroup/bank/resc_cflt_ratio etc.
|
||||
- 5: MemoryUB contains ub_read/write_bw_mte, ub_read/write_bw_vector, ub_/write_bw_scalar etc.
|
||||
- 5: MemoryUB contains ub_read/write_bw_mte, ub_read/write_bw_vector, ub\_/write_bw_scalar etc.
|
||||
|
||||
l2_cache (bool, optional): (Ascend only) Whether to collect l2 cache data, collect when True. Default: False.
|
||||
|
||||
|
|
|
@ -75,17 +75,18 @@ class SymbolTree:
|
|||
raise TypeError(f"For call-function Node, got unsupported kwarg value: {v}, type: {type(v)}")
|
||||
|
||||
def create_call_function(self, func, targets, *args, **kwargs):
|
||||
"""
|
||||
r"""
|
||||
Create a Node object and generate the execution code to insert into the source code.
|
||||
The source code calls the 'func' function with 'args' and' kwargs' as parameters.
|
||||
|
||||
Args:
|
||||
func (FunctionType) - The function to be called.
|
||||
targets (list [str]) - indicates the output name. As the output of the node in the source code.
|
||||
args (Union[MsDtypes, ParamTypes]) - parameter name of the node. Used as a parameter to a code statement in
|
||||
func (FunctionType): The function to be called.
|
||||
targets (list[str]): indicates the output name. As the output of the node in the source code.
|
||||
args (Union[MsDtypes, ParamTypes]): parameter name of the node. Used as a parameter to a code statement in
|
||||
source code. The default value is None, which means there is no parameter input in the cell.
|
||||
kwargs ({str: Union[MsDtypes, ParamTypes]}) - The key type must be str, and the value must be value or type
|
||||
must be ParamTypes. The input parameter name used to describe the formal parameter with a keyword.
|
||||
kwargs (dict{str,Union[MsDtypes, ParamTypes]}): The key type must be str,
|
||||
and the value must be value or type must be ParamTypes.
|
||||
The input parameter name used to describe the formal parameter with a keyword.
|
||||
Enter the name in the source code as the 'kwargs' in the statement expression.The default value is
|
||||
None, which means there is no 'kwargs' input.
|
||||
|
||||
|
|
Loading…
Reference in New Issue