Merge pull request #12748 from velconia/port_pybind11

Port print_function and make more efficient
revert-12469-sum_op_dim_fix
Qiyang Min 7 years ago committed by GitHub
commit 0abfbd1c41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,6 +28,8 @@ images per class.
""" """
from __future__ import print_function
import itertools import itertools
import numpy import numpy
import paddle.dataset.common import paddle.dataset.common

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import requests import requests
import hashlib import hashlib
import os import os

@ -20,6 +20,8 @@ dataset. And a pre-trained word vector model based on Wikipedia corpus is used
to initialize SRL model. to initialize SRL model.
""" """
from __future__ import print_function
import tarfile import tarfile
import gzip import gzip
import itertools import itertools

@ -28,6 +28,9 @@ Graphics and Image Processing (2008)
http://www.robots.ox.ac.uk/~vgg/publications/papers/nilsback08.{pdf,ps.gz}. http://www.robots.ox.ac.uk/~vgg/publications/papers/nilsback08.{pdf,ps.gz}.
""" """
from __future__ import print_function
import itertools import itertools
import functools import functools
from .common import download from .common import download
@ -117,7 +120,7 @@ def reader_creator(data_file,
file = file.strip() file = file.strip()
batch = None batch = None
with open(file, 'rb') as f: with open(file, 'rb') as f:
batch = pickle.loads(f.read()) batch = pickle.load(f)
data = batch['data'] data = batch['data']
labels = batch['label'] labels = batch['label']
for sample, label in zip(data, batch['label']): for sample, label in zip(data, batch['label']):

@ -29,6 +29,9 @@ the image layout as follows.
formats can be used for training. Noted that, the format should formats can be used for training. Noted that, the format should
be keep consistent between the training and inference peroid. be keep consistent between the training and inference peroid.
""" """
from __future__ import print_function
import numpy as np import numpy as np
try: try:
import cv2 import cv2

@ -20,6 +20,8 @@ of 25,000 highly polar movie reviews for training, and 25,000 for testing.
Besides, this module also provides API for building dictionary. Besides, this module also provides API for building dictionary.
""" """
from __future__ import print_function
import paddle.dataset.common import paddle.dataset.common
import collections import collections
import tarfile import tarfile

@ -18,6 +18,9 @@ This module will download dataset from
http://www.fit.vutbr.cz/~imikolov/rnnlm/ and parse training set and test set http://www.fit.vutbr.cz/~imikolov/rnnlm/ and parse training set and test set
into paddle reader creators. into paddle reader creators.
""" """
from __future__ import print_function
import paddle.dataset.common import paddle.dataset.common
import collections import collections
import tarfile import tarfile

@ -17,6 +17,9 @@ MNIST dataset.
This module will download dataset from http://yann.lecun.com/exdb/mnist/ and This module will download dataset from http://yann.lecun.com/exdb/mnist/ and
parse training set and test set into paddle reader creators. parse training set and test set into paddle reader creators.
""" """
from __future__ import print_function
import paddle.dataset.common import paddle.dataset.common
import subprocess import subprocess
import numpy import numpy

@ -22,6 +22,8 @@ set and test set into paddle reader creators.
""" """
from __future__ import print_function
import zipfile import zipfile
import paddle.dataset.common import paddle.dataset.common
import re import re

@ -23,6 +23,8 @@ http://research.microsoft.com/en-us/um/beijing/projects/letor/LETOR4.0/Data/MQ20
""" """
from __future__ import print_function
import os import os
import functools import functools
import rarfile import rarfile

@ -20,6 +20,8 @@ The script fetch and preprocess movie_reviews data set that provided by NLTK
TODO(yuyang18): Complete dataset. TODO(yuyang18): Complete dataset.
""" """
from __future__ import print_function
import six import six
import collections import collections
from itertools import chain from itertools import chain

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.cifar import paddle.dataset.cifar
import unittest import unittest

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.common import paddle.dataset.common
import unittest import unittest
import tempfile import tempfile

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.flowers import paddle.dataset.flowers
import unittest import unittest

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.imdb import paddle.dataset.imdb
import unittest import unittest
import re import re

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.imikolov import paddle.dataset.imikolov
import unittest import unittest

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.mnist import paddle.dataset.mnist
import unittest import unittest

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.mq2007 import paddle.dataset.mq2007
import unittest import unittest

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np

@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import unittest import unittest
import nltk import nltk
import paddle.dataset.sentiment as st import paddle.dataset.sentiment as st

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.voc2012 import paddle.dataset.voc2012
import unittest import unittest

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import paddle.dataset.wmt16 import paddle.dataset.wmt16
import unittest import unittest

@ -19,7 +19,7 @@ https://archive.ics.uci.edu/ml/machine-learning-databases/housing/ and
parse training set and test set into paddle reader creators. parse training set and test set into paddle reader creators.
""" """
import os from __future__ import print_function
import numpy as np import numpy as np
import six import six

@ -19,6 +19,8 @@ to training/test sets has been maintained. The total number of images
with segmentation has been increased from 7,062 to 9,993. with segmentation has been increased from 7,062 to 9,993.
""" """
from __future__ import print_function
import tarfile import tarfile
import io import io
import numpy as np import numpy as np

@ -19,6 +19,9 @@ http://paddlepaddle.cdn.bcebos.com/demo/wmt_shrinked_data/wmt14.tgz and
parse training set and test set into paddle reader creators. parse training set and test set into paddle reader creators.
""" """
from __future__ import print_function
import six import six
import tarfile import tarfile
import gzip import gzip

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save