Beispiel #1
0
def one_generator(shape, dtype):
    return generators.constant(np.ones(shape, dtype=dtype))
Beispiel #2
0
def identity_generator(shape, dtype):
    assert len(shape) == 2 and shape[0] == shape[1]
    return generators.constant(np.identity(shape[0], dtype=dtype))
Beispiel #3
0
def zero_generator(shape, dtype):
    return generators.constant(np.zeros(shape, dtype=dtype))