def main(): import numpy as np np.random.seed(314) x = np.random.rand(12, 6, 4).astype(np.float32) testtools.generate_testcase(Size(), [x])
def main(): model = A() a = np.random.rand(3, 4).astype(np.float32) b = np.random.rand(3, 4).astype(np.float32) c = np.random.rand(3, 4).astype(np.float32) testtools.generate_testcase(model, [a, b, c])
def main(): np.random.seed(314) a = np.random.rand(3, 5, 4).astype(np.float32) testtools.generate_testcase(Softmax(), [a]) testtools.generate_testcase(SoftmaxAxis(), [a], subname='axis')
def main(): model = A() np.random.seed(123) x = np.random.rand(2, 20, 15, 17).astype(np.float32) testtools.generate_testcase(model, [x])
def main(): import numpy as np np.random.seed(314) x = np.random.rand(5, 7).astype(np.float32) y = np.random.rand(7, 4).astype(np.float32) testtools.generate_testcase(Matmul, [x, y])
def main(): np.random.seed(314) model = A(3) x = np.random.rand(5, 7).astype(np.float32) testtools.generate_testcase(model, [x])
def main(): model = Sigmoid() np.random.seed(314) x = np.random.rand(6, 4).astype(np.float32) testtools.generate_testcase(model, [x])
def main(): model = A() v = np.random.rand(3, 5).astype(np.float32) w = np.random.rand(3, 5).astype(np.float32) testtools.generate_testcase(model, [v, w])
def main(): import numpy as np np.random.seed(314) model = ExpandDims() x = np.random.rand(6, 4).astype(np.float32) - 0.5 testtools.generate_testcase(model, [x])
def main(): np.random.seed(314) model = Alex() v = np.random.rand(5, 3, 227, 227).astype(np.float32) t = np.random.randint(1000, size=5) testtools.generate_testcase(model, [v, t])
def main(): out_n = 2 batch_size = 1 model = A() v = np.random.rand(batch_size, out_n).astype(np.float32) w = np.random.randint(out_n, size=batch_size) testtools.generate_testcase(model, [v, w])
def main(): np.random.seed(314) v = np.random.rand(3, 7).astype(np.float32) model = A() result = model(v) testtools.generate_testcase(model, [v])
def main(): import numpy as np np.random.seed(12) model = A() ps = [3, 1, 4, 1, 5, 9, 2] testtools.generate_testcase(model, [ps])
def main(): import numpy as np np.random.seed(314) model = A() v = np.random.rand(2, 3, 5, 5).astype(np.float32) testtools.generate_testcase(model, [v])
def main(): import numpy as np np.random.seed(314) model = A() x = np.random.rand(12, 6, 4).astype(np.float32) p = np.int64(3) testtools.generate_testcase(model, [x, p])
def main(): import numpy as np np.random.seed(314) model = A() x = np.random.rand(5, 7).astype(np.float32) x = [x] testtools.generate_testcase(model, x)
def main(): np.random.seed(123) x = np.random.rand(2, 20, 15, 17).astype(np.float32) testtools.generate_testcase(AvgPool(), [x], subname='default') testtools.generate_testcase(AvgPoolPad(), [x], subname='withpad') testtools.generate_testcase(AvgPoolNoStride(), [x], subname='withoutstride') testtools.generate_testcase(AvgPoolPadTuple(), [x], subname='withpadtuple') testtools.generate_testcase(AvgPoolPadTupleInit(), [x], subname='withpadtupleinit')
def main(): np.random.seed(314) out_n = 4 batch_size = 100 model = MLP(8, out_n) v = np.random.rand(batch_size, 3).astype(np.float32) w = np.random.randint(out_n, size=batch_size) testtools.generate_testcase(model, [v, w])
def main(): np.random.seed(314) model = A() v = np.random.rand(10, 20).astype(np.float32) ps = np.array([3, 4]) qs = np.array([1, 2, 3, 4, 5]) p = np.int64(5) testtools.generate_testcase(model, [v, ps, p, qs])
def main(): np.random.seed(314) x = np.random.rand(6, 4, 1).astype(np.float32) - 0.5 testtools.generate_testcase(BroadcastTo(), [x], subname='basic') x = np.random.rand(6, 3).astype(np.float32) - 0.5 testtools.generate_testcase(BroadcastToBackprop(), [x], backprop=True, subname='with_backprop')
def main(): np.random.seed(314) n_in = 10 n_out = 20 model = A(n_in, n_out) # print(list(model.namedparams())) v = np.random.randint(0, 10, size=5) testtools.generate_testcase(model, [v])
def main(): import numpy as np np.random.seed(314) model = A() v = np.random.rand(10, 20).astype(np.float32) result = model(v) testtools.generate_testcase(model, [v])
def main(): n_maxlen = 10 model = A() u = np.random.rand(n_maxlen + 6).astype(np.float32) v = np.random.rand(n_maxlen + 6, n_maxlen + 6).astype(np.float32) w = np.random.randint(0, n_maxlen, size=2) testtools.generate_testcase(model, [u, v, w]) x = np.random.rand(4, 3, 5, 7) testtools.generate_testcase(ListSlice(), [x], subname='list')
def main(): for name, cls in [('eq', Equal), ('neq', NotEqual), ('gt', GreaterThan), ('ge', GreaterEqual), ('lt', LessThan), ('le', LessEqual)]: for x, y in [(4, 5), (4, 4), (4, 3)]: testtools.generate_testcase(cls(), [x, y], subname='%d_%s_%d' % (x, name, y)) for name, cls in [('is', Is), ('isnt', IsNot)]: for x, y in [(None, None), (42, None), (True, None), (True, False), (True, True), (False, False), (True, [42]), ([43], [43]), (np.array(45), np.array(45))]: testtools.generate_testcase(cls(), [x, y], subname='%s_%s_%s' % (x, name, y))
def main(): import numpy as np np.random.seed(314) model = ResNet50() bsize = 2 # batch * channel * H * W # 195 ~ 226 までがOKっぽい v = np.random.rand(bsize, 3, 224, 224).astype(np.float32) t = np.random.randint(1000, size=bsize).astype(np.int32) testtools.generate_testcase(model, [v, t])
def main(): v = np.random.rand(5, 4, 2).astype(np.float32) w = np.random.rand(5, 4, 2).astype(np.float32) testtools.generate_testcase(Stack, [v, w]) testtools.generate_testcase(StackAxis0, [v, w], subname='axis0') testtools.generate_testcase(StackAxis1, [v, w], subname='axis1') testtools.generate_testcase(StackAxis2, [v, w], subname='axis2')
def main(): np.random.seed(314) model = A(3) x = np.random.rand(5, 7).astype(np.float32) testtools.generate_testcase(model, [x]) # Value mismatch bug. num_hidden = 5 model = lambda: B(num_hidden) xs = [] for l in [4, 3, 2]: xs.append(np.random.rand(l, num_hidden).astype(dtype=np.float32)) h = np.zeros((3, num_hidden), dtype=np.float32)
def main(): testtools.generate_testcase(Basic(), [10], subname='Basic') testtools.generate_testcase(Index(), [10], subname='Index') testtools.generate_testcase(Slice(), [10], subname='Slice') testtools.generate_testcase(Append(), [10], subname='Append') model = A() wn = 1 v = np.random.rand(10).astype(np.float32) w = np.random.randint(0, 5, size=wn) p = np.int64(wn) testtools.generate_testcase(model, [v, w, p], subname='A')
def main(): np.random.seed(314) batch_size = 3 num_hidden = 5 sequence_length = 4 model = LinkInFor(num_hidden) x = np.random.rand( batch_size, sequence_length, num_hidden).astype(np.float32) h = np.random.rand(batch_size, num_hidden).astype(np.float32) args = [x, h, np.arange(sequence_length)] #dprint(model(*args)) testtools.generate_testcase(model, args)
def main(): import numpy as np np.random.seed(12) x = np.random.rand(2, 3, 4).astype(np.float32) testtools.generate_testcase(Separate, [x]) testtools.generate_testcase(SeparateAxis0, [x], subname='axis_0') testtools.generate_testcase(SeparateAxis1, [x], subname='axis_1') testtools.generate_testcase(SeparateAxis2, [x], subname='axis_2')