Browse Source

使用 .. todo:: 隐藏了可能被抽到文档中的 TODO 注释

tags/v0.4.10
ChenXin 5 years ago
parent
commit
fec3216a0e
5 changed files with 13 additions and 6 deletions
  1. +4
    -1
      fastNLP/core/dataset.py
  2. +1
    -2
      fastNLP/core/losses.py
  3. +2
    -1
      fastNLP/io/base_loader.py
  4. +2
    -1
      fastNLP/modules/aggregator/attention.py
  5. +4
    -1
      fastNLP/modules/utils.py

+ 4
- 1
fastNLP/core/dataset.py View File

@@ -58,7 +58,10 @@
2 DataSet与预处理
常见的预处理有如下几种

2.1 从某个文本文件读取内容 # TODO 引用DataLoader
2.1 从某个文本文件读取内容 #

.. todo::
引用DataLoader

Example::



+ 1
- 2
fastNLP/core/losses.py View File

@@ -221,8 +221,7 @@ class CrossEntropyLoss(LossBase):
"""
def __init__(self, pred=None, target=None, padding_idx=-100):
# TODO 需要做一些检查,F.cross_entropy在计算时,如果pred是(16, 10 ,4), target的形状按道理应该是(16, 10), 但实际却需要
# TODO (16, 4)
# TODO 需要做一些检查,F.cross_entropy在计算时,如果pred是(16, 10 ,4), target的形状按道理应该是(16, 10), 但实际需要(16,4)
super(CrossEntropyLoss, self).__init__()
self._init_param_map(pred=pred, target=target)
self.padding_idx = padding_idx


+ 2
- 1
fastNLP/io/base_loader.py View File

@@ -47,7 +47,6 @@ class BaseLoader(object):


class DataLoaderRegister:
# TODO 这个类使用在何处?
_readers = {}

@classmethod
@@ -64,3 +63,5 @@ class DataLoaderRegister:
if read_fn_name in cls._readers:
return cls._readers[read_fn_name]
raise AttributeError('no read function: {}'.format(read_fn_name))
# TODO 这个类使用在何处?

+ 2
- 1
fastNLP/modules/aggregator/attention.py View File

@@ -12,7 +12,8 @@ from ..utils import initial_parameter

class DotAttention(nn.Module):
"""
TODO
.. todo::
补上文档
"""
def __init__(self, key_size, value_size, dropout=0):
super(DotAttention, self).__init__()


+ 4
- 1
fastNLP/modules/utils.py View File

@@ -70,7 +70,10 @@ def initial_parameter(net, initial_method=None):

def get_embeddings(init_embed):
"""
得到词嵌入 TODO
得到词嵌入
.. todo::
补上文档

:param init_embed: 单词词典, 可以是 tuple, 包括(num_embedings, embedding_dim), 即
embedding的大小和每个词的维度. 也可以传入 nn.Embedding 对象,


Loading…
Cancel
Save