def placeholder(shape=None, ndim=None, dtype=None, sparse=False, name=None):
name = _prepare_name(name, 'placeholder')
if sparse:
raise Exception('Sparse tensors are not supported yet :( ')
if dtype is None:
dtype = keras.backend.floatx()
ktorch_tensor = Tensor(name=name, shape=shape, ndim=ndim, dtype=dtype)
make_keras_tensor(ktorch_tensor)
ktorch_tensor._ktorch_placeholder = True
return ktorch_tensor
评论列表
文章目录