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
def create_Value_from_NumPy(nd, dev): view = create_NDArrayView_from_NumPy(nd, dev) value = cntk_py.Value(view) return value
def create_Value(shape, data_type, dev): value = cntk_py.Value(create_NDArrayView(shape, data_type, dev)) return value