Skip to content

Instantly share code, notes, and snippets.

@bayerj
Last active December 20, 2015 03:48
Show Gist options
  • Save bayerj/6065726 to your computer and use it in GitHub Desktop.
Save bayerj/6065726 to your computer and use it in GitHub Desktop.
Traceback (most recent call last):
File "theanorngclone.py", line 12, in <module>
f = theano.function([x_sub], samples_sub)
File "/Users/bayerj/devel/Theano/theano/compile/function.py", line 222, in function
profile=profile)
File "/Users/bayerj/devel/Theano/theano/compile/pfunc.py", line 506, in pfunc
on_unused_input=on_unused_input)
File "/Users/bayerj/devel/Theano/theano/compile/function_module.py", line 1298, in orig_function
on_unused_input=on_unused_input).create(
File "/Users/bayerj/devel/Theano/theano/compile/function_module.py", line 994, in __init__
fgraph, additional_outputs = std_fgraph(expanded_inputs, outputs, accept_inplace)
File "/Users/bayerj/devel/Theano/theano/compile/function_module.py", line 133, in std_fgraph
fgraph = gof.fg.FunctionGraph(inputs, outputs)
File "/Users/bayerj/devel/Theano/theano/gof/fg.py", line 107, in __init__
self.__import_r__(outputs)
File "/Users/bayerj/devel/Theano/theano/gof/fg.py", line 225, in __import_r__
self.__import__(apply_node)
File "/Users/bayerj/devel/Theano/theano/gof/fg.py", line 316, in __import__
r)
theano.gof.fg.MissingInputError: ('An input of the graph, used to compute Shape(x), was not provided and not given a value', x)
import theano
import theano.tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
x = T.matrix('x')
x_sub = T.matrix('x_sub')
rng = RandomStreams()
samples = rng.normal(size=x.shape)
samples_sub = theano.clone(samples, {x: x_sub})
f = theano.function([x_sub], samples_sub)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment