Skip to content

Commit

Permalink
correct typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Jan 2, 2020
1 parent ba38427 commit aae3a10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hanlp/callbacks/fine_csv_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import tensorflow as tf


class StreamTableFormater(object):
class StreamTableFormatter(object):

def __init__(self) -> None:
super().__init__()
Expand Down Expand Up @@ -39,7 +39,7 @@ def __init__(self, filename, separator=',', append=False):
self.filename = filename
self.out: TextIOWrapper = None
self.keys = []
self.formatter = StreamTableFormater()
self.formatter = StreamTableFormatter()

def on_train_begin(self, logs=None):
super().on_train_begin(logs)
Expand Down
6 changes: 3 additions & 3 deletions hanlp/utils/tf_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def set_gpu(idx=0):
idx : int
Which GPU to use
"""
gpus = get_visiable_gpus()
gpus = get_visible_gpus()
if gpus:
try:
tf.config.experimental.set_visible_devices(gpus[idx], 'GPU')
Expand All @@ -59,13 +59,13 @@ def set_gpu(idx=0):
raise e


def get_visiable_gpus():
def get_visible_gpus():
gpus = tf.config.experimental.list_physical_devices('GPU')
return gpus


def set_gpu_memory_growth(growth=True):
gpus = get_visiable_gpus()
gpus = get_visible_gpus()
if gpus:
try:
# Currently, memory growth needs to be the same across GPUs
Expand Down

0 comments on commit aae3a10

Please sign in to comment.