def create_constant_tensor(shape, value):
    """Creates tensor with `shape`, filled with `value`."""
    if len(shape) == 1:
        return [value] * shape[0]
    return [create_constant_tensor(shape[1:], value) for _ in range(shape[0])]