Skip to content

Commit a6b9e7e

Browse files
committed
add constants.py
1 parent 46b31a5 commit a6b9e7e

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

cusim/constants.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2021 Jisang Yoon
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the Apache 2.0 license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
# pylint: disable=no-name-in-module,too-few-public-methods,no-member
8+
9+
EPS = 1e-10
10+
WARP_SIZE = 32

cusim/culda/pyculda.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
from cusim import aux, IoUtils
1919
from cusim.culda.culda_bind import CuLDABind
2020
from cusim.config_pb2 import CuLDAConfigProto
21+
from cusim.constants import EPS, WARP_SIZE
2122

22-
EPS = 1e-10
23-
WARP_SIZE = 32
2423

2524
class CuLDA:
2625
def __init__(self, opt=None):

cusim/cuw2v/pycuw2v.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
from cusim import aux, IoUtils
1818
from cusim.cuw2v.cuw2v_bind import CuW2VBind
1919
from cusim.config_pb2 import CuW2VConfigProto
20-
21-
EPS = 1e-10
22-
WARP_SIZE = 32
20+
from cusim.constants import EPS, WARP_SIZE
2321

2422
class CuW2V:
2523
def __init__(self, opt=None):
@@ -102,7 +100,7 @@ def train_model(self):
102100
for epoch in range(1, self.opt.epochs + 1):
103101
self.logger.info("Epoch %d / %d", epoch, self.opt.epochs)
104102
self._train_epoch(h5f)
105-
self.pull()
103+
self.obj.pull()
106104
h5f.close()
107105

108106
def _train_epoch(self, h5f):

examples/example1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def run_lda():
6868

6969
def run_w2v():
7070
opt = {
71-
"c_log_level": 3,
71+
# "c_log_level": 3,
7272
"data_path": DATA_PATH,
7373
"processed_data_dir": PROCESSED_DATA_DIR,
7474
# "skip_preprocess":True,

0 commit comments

Comments
 (0)