Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dboyliao committed Mar 20, 2020
1 parent 7e0aea8 commit 70d4ba5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utensor_cgen/ir/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ class TensorInfo(IRBase, _NoShallowCopyMixin):
dtype = attr.ib(validator=instance_of(np.dtype))

shape = attr.ib(validator=instance_of((list, type(None))))
attributes = attr.ib(factory=dict, validator=instance_of(dict))

@shape.validator
def check(self, attrib, shape_values):
if shape_values is not None:
for v in shape_values:
assert isinstance(v, (int, type(None))), \
"shape should be a list of integers"

_ugraph = attr.ib(repr=False)
@_ugraph.validator
def check(self, attrib, value):
if not isinstance(value, uTensorGraph):
raise ValueError('Expecting a uTensorGraph, get {}'.format(type(value)))

attributes = attr.ib(factory=dict, validator=instance_of(dict))

_NULL_PREFIX = 'utensor_null'

def move_into(self, ugraph):
Expand Down

0 comments on commit 70d4ba5

Please sign in to comment.