예제 #1
0
def create_Value_for_Variable(var, shape=None, dev=None, mask=None):
    if not dev:
        dev = cntk_py.DeviceDescriptor.cpu_device()

    if shape is None:
        shape = var.shape().dimensions()
    view = cntk_py.NDArrayView(var.get_data_type(),
                               cntk_py.StorageFormat_Dense, shape, dev)
    if mask:
        value = cntk_py.Value(view, mask)
    else:
        value = cntk_py.Value(view)
    return value
예제 #2
0
def create_Value_from_NumPy(nd, dev):
    view = create_NDArrayView_from_NumPy(nd, dev)
    value = cntk_py.Value(view)
    return value
예제 #3
0
def create_Value(shape, data_type, dev):
    value = cntk_py.Value(create_NDArrayView(shape, data_type, dev))
    return value