singa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhaoj...@apache.org
Subject incubator-singa git commit: SINGA-269 - Fix a bug from tensor multiplication and a typo
Date Thu, 17 Nov 2016 06:04:25 GMT
Repository: incubator-singa
Updated Branches:
  refs/heads/master e5a3e52ee -> 22d98bb72


SINGA-269 - Fix a bug from tensor multiplication and a typo

Fix the error from tensor * float;
Fix the typo of 'delimeter' (should be 'delimiter') in data.py


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/22d98bb7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/22d98bb7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/22d98bb7

Branch: refs/heads/master
Commit: 22d98bb72494bff8a03d44155b8808ddfa1bcd5b
Parents: e5a3e52
Author: Wei Wang <wangwei@comp.nus.edu.sg>
Authored: Tue Nov 15 19:48:56 2016 +0800
Committer: Wei Wang <wangwei@comp.nus.edu.sg>
Committed: Tue Nov 15 19:48:56 2016 +0800

----------------------------------------------------------------------
 python/singa/data.py   | 14 +++++++-------
 python/singa/tensor.py |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/22d98bb7/python/singa/data.py
----------------------------------------------------------------------
diff --git a/python/singa/data.py b/python/singa/data.py
index f9f6c78..4fffd92 100644
--- a/python/singa/data.py
+++ b/python/singa/data.py
@@ -33,7 +33,7 @@ Example usage::
             (96, 96)).flip().get()
 
     data = ImageBatchIter('train.txt', 3,
-                          image_transform, shuffle=True, delimeter=',',
+                          image_transform, shuffle=True, delimiter=',',
                           image_folder='images/',
                           capacity=10)
     data.start()
@@ -61,25 +61,25 @@ class ImageBatchIter:
 
     Args:
         img_list_file(str): name of the file containing image meta data; each
-                            line consists of image_path_suffix delimeter label
+                            line consists of image_path_suffix delimiter label
         batch_size(int): num of samples in one mini-batch
         image_transform: a function for image augmentation; it accepts the full
                         image path and outputs a list of augmented images.
         shuffle(boolean): True for shuffling images in the list
-        delimeter(char): delimeter between image_path_suffix and label, e.g.,
+        delimiter(char): delimiter between image_path_suffix and label, e.g.,
                          space or comma
         image_folder(boolean): prefix of the image path
         capacity(int): the max num of mini-batches in the internal queue.
     '''
 
     def __init__(self, img_list_file, batch_size, image_transform,
-                 shuffle=True, delimeter=' ', image_folder=None, capacity=10):
+                 shuffle=True, delimiter=' ', image_folder=None, capacity=10):
         self.img_list_file = img_list_file
         self.queue = Queue(capacity)
         self.batch_size = batch_size
         self.image_transform = image_transform
         self.shuffle = shuffle
-        self.delimeter = delimeter
+        self.delimiter = delimiter
         self.image_folder = image_folder
         self.stop = False
         self.p = None
@@ -107,7 +107,7 @@ class ImageBatchIter:
     def run(self):
         img_list = []
         for line in open(self.img_list_file, 'r'):
-            item = line.split(self.delimeter)
+            item = line.split(self.delimiter)
             img_path = item[0]
             img_label = int(item[1])
             img_list.append((img_label, img_path))
@@ -153,7 +153,7 @@ if __name__ == '__main__':
             (96, 96)).flip().get()
 
     data = ImageBatchIter('train.txt', 3,
-                          image_transform, shuffle=True, delimeter=',',
+                          image_transform, shuffle=True, delimiter=',',
                           image_folder='images/',
                           capacity=10)
     data.start()

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/22d98bb7/python/singa/tensor.py
----------------------------------------------------------------------
diff --git a/python/singa/tensor.py b/python/singa/tensor.py
index c28f5b5..4b5a053 100644
--- a/python/singa/tensor.py
+++ b/python/singa/tensor.py
@@ -403,7 +403,7 @@ class Tensor(object):
             return from_raw_tensor(
                 singa.__mul__(self.singa_tensor, rhs.singa_tensor))
         else:
-            return _call_singa_func(singa.EltwiseMulFloat,
+            return _call_singa_func(singa.MultFloat,
                                     self.singa_tensor, rhs)
 
     def __div__(self, rhs):


Mime
View raw message