Esempio n. 1
0
 def net_func():
     x = layers.fill_constant(shape=[2, 3], dtype='float32', value=2.0)
     condition = layers.reduce_max(x) < 1.0
     layers.Assert(condition, [x], 10, name="test")
Esempio n. 2
0
 def net_func():
     x = layers.fill_constant(shape=[10], dtype='float32', value=2.0)
     condition = layers.reduce_max(x) < 1.0
     layers.Assert(condition, (x, ), 5)
Esempio n. 3
0
 def net_func():
     condition = layers.fill_constant(shape=[1, 2],
                                      dtype='bool',
                                      value=True)
     layers.Assert(condition, [])
Esempio n. 4
0
 def net_func():
     zero = layers.fill_constant(shape=[1], dtype='int64', value=0)
     one = layers.fill_constant(shape=[1], dtype='int64', value=1)
     condition = layers.less_than(one, zero)  # False
     layers.Assert(condition, [zero, one])
Esempio n. 5
0
 def net_func():
     condition = layers.fill_constant(shape=[1],
                                      dtype='bool',
                                      value=False)
     layers.Assert(condition)