在不知道张量的形状和类型的情况下打印 theano.tensor
printing theano.tensor without having any idea about the shape and type of the tensor
我正在调试一个我没有写过的代码。我想打印出计算如下的 state_below_
变量:
state_below_ = tensor.dot(state_below*emb_dropout[1], tparams[pp(prefix, 'W')]) +\
tparams[pp(prefix, 'b')]
当我使用 state_below_.eval()
时,我得到
MissingInputError: ("An input of the graph, used to compute
Reshape{1}(y_sampler, TensorConstant{(1,) of -1}), was not provided
and not given a value.Use the Theano flag
exception_verbosity='high',for more information on this error.",
y_sampler)
错误。我怎样才能打印这个该死的 "state_below_" 值?
谢谢,
当您使用纯符号变量时,您必须编译一个具有相应输入和输出的函数。然后,您必须使用各个符号变量的常量值调用您的函数。
否则,如果您使用的是共享变量,则您编写的方式将起作用。
function , shared variable
的文档
我正在调试一个我没有写过的代码。我想打印出计算如下的 state_below_
变量:
state_below_ = tensor.dot(state_below*emb_dropout[1], tparams[pp(prefix, 'W')]) +\
tparams[pp(prefix, 'b')]
当我使用 state_below_.eval()
时,我得到
MissingInputError: ("An input of the graph, used to compute Reshape{1}(y_sampler, TensorConstant{(1,) of -1}), was not provided and not given a value.Use the Theano flag exception_verbosity='high',for more information on this error.", y_sampler)
错误。我怎样才能打印这个该死的 "state_below_" 值?
谢谢,
当您使用纯符号变量时,您必须编译一个具有相应输入和输出的函数。然后,您必须使用各个符号变量的常量值调用您的函数。 否则,如果您使用的是共享变量,则您编写的方式将起作用。 function , shared variable
的文档