Browse Source

Merge branch 'trainer' of github.com:FengZiYjun/fastNLP into trainer

tags/v0.2.0^2
yh 5 years ago
parent
commit
f7c29b85d7
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      fastNLP/core/fieldarray.py

+ 6
- 4
fastNLP/core/fieldarray.py View File

@@ -45,8 +45,9 @@ class FieldArray(object):

@is_input.setter
def is_input(self, value):
self.pytype = self._type_detection(self.content)
self.dtype = self._map_to_np_type(self.pytype)
if value is True:
self.pytype = self._type_detection(self.content)
self.dtype = self._map_to_np_type(self.pytype)
self._is_input = value

@property
@@ -55,8 +56,9 @@ class FieldArray(object):

@is_target.setter
def is_target(self, value):
self.pytype = self._type_detection(self.content)
self.dtype = self._map_to_np_type(self.pytype)
if value is True:
self.pytype = self._type_detection(self.content)
self.dtype = self._map_to_np_type(self.pytype)
self._is_target = value

def _type_detection(self, content):


Loading…
Cancel
Save