Browse Source

Replace np.sum to correct deprecated warning

tags/v0.5.0-beta
Cathy Wong 5 years ago
parent
commit
201008d49b
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      mindspore/dataset/engine/validators.py
  2. +2
    -2
      mindspore/dataset/transforms/vision/py_transforms.py

+ 1
- 1
mindspore/dataset/engine/validators.py View File

@@ -1422,7 +1422,7 @@ def check_numpyslicesdataset(method):

# Consider input is a tuple of dict
elif isinstance(data[0], dict):
data_column = np.sum(len(list(data[i].keys())) for i in range(len(data)))
data_column = sum(len(list(data[i].keys())) for i in range(len(data)))
if column_num != data_column:
raise ValueError("Num of column is {0}, but required is {1}.".format(column_num, data_column))



+ 2
- 2
mindspore/dataset/transforms/vision/py_transforms.py View File

@@ -606,7 +606,7 @@ class RandomRotation:

class RandomOrder:
"""
Perform a series of transforms to the input PIL image in a random oreder.
Perform a series of transforms to the input PIL image in a random order.

Args:
transforms (list): List of the transformations to be applied.
@@ -1087,7 +1087,7 @@ class RandomAffine:
The horizontal and vertical shift is selected randomly from the range:
(-tx*width, tx*width) and (-ty*height, ty*height), respectively.
If None, no translations gets applied.
scale (sequence, optional): Scaling factor interval (default=None, riginal scale is used).
scale (sequence, optional): Scaling factor interval (default=None, original scale is used).
shear (int or float or sequence, optional): Range of shear factor (default=None).
If a number 'shear', then a shear parallel to the x axis in the range of (-shear, +shear) is applied.
If a tuple or list of size 2, then a shear parallel to the x axis in the range of (shear[0], shear[1])


Loading…
Cancel
Save