Browse Source

Rectification of operator ease of use

tags/v1.3.0
dinglinhe 4 years ago
parent
commit
316662cacb
3 changed files with 727 additions and 148 deletions
  1. +3
    -2
      mindspore/nn/sparse/sparse.py
  2. +723
    -145
      mindspore/ops/operations/array_ops.py
  3. +1
    -1
      mindspore/ops/operations/nn_ops.py

+ 3
- 2
mindspore/nn/sparse/sparse.py View File

@@ -21,14 +21,15 @@ class SparseToDense(Cell):
"""
Converts a sparse tensor into dense.

Not yet supported by any backend at the moment.

Inputs:
- **sparse_tensor** (:class:`mindspore.SparseTensor`): the sparse tensor to convert.

Outputs:
Tensor, converted from sparse tensor.

Args:
sparse_tensor (SparseTensor): the sparse tensor to convert.

Raises:
TypeError: If the`sparse_tensor.indices` data type is neither int32 nor int64.
TypeError: If the 'sparse_tensor.values' data type is not a Number or bool.


+ 723
- 145
mindspore/ops/operations/array_ops.py
File diff suppressed because it is too large
View File


+ 1
- 1
mindspore/ops/operations/nn_ops.py View File

@@ -7788,7 +7788,7 @@ class AvgPool3D(Primitive):
>>> avg_pool3d = ops.AvgPool3D(kernel_size=2, strides=1, pad_mode="valid")
>>> output = avg_pool3d(input)
>>> print(output)
[[[[[5. 6.]]]
[[[[[ 5. 6.]]]
[[[17. 18.]]]]]
"""
@prim_attr_register


Loading…
Cancel
Save