# Buggy code
def __init__(self, dist, transform, *args, **kwargs):
    """
    Parameters
    ----------
    dist : Distribution
    transform : Transform
    args, kwargs
        arguments to Distribution"""
    forward = transform.forward
    testval = forward(dist.default())

    self.dist = dist
    self.transform_used = transform
    v = forward(FreeRV(name="v", distribution=dist))
    self.type = v.type

    super(TransformedDistribution, self).__init__(
        v.shape.tag.test_value, v.dtype, testval, dist.defaults, *args, **kwargs
    )

    if transform.name == "stickbreaking":
        b = np.hstack(((np.atleast_1d(self.shape) == 1)[:-1], False))
        # force the last dim not broadcastable
        self.type = tt.TensorType(v.dtype, b)


# Traceback (MissingInputError)
Traceback (most recent call last):

File "<ipython-input-1-e7f2b743f1a1>", line 5, in <module>
pm.sample(1000)

File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 273, in sample
return sample_func(**sample_args)[discard:]

File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 288, in _sample
for it, strace in enumerate(sampling):

File "/usr/local/lib/python3.5/dist-packages/tqdm/_tqdm.py", line 862, in __iter__
for obj in iterable:

File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 367, in _iter_sample
_update_start_vals(start, model.test_point, model)

File "/usr/local/lib/python3.5/dist-packages/pymc3/sampling.py", line 483, in _update_start_vals
b[tname] = transform_func[0].forward(a[name]).eval()

File "/usr/local/lib/python3.5/dist-packages/theano/gof/graph.py", line 516, in eval
self._fn_cache[inputs] = theano.function(inputs, self)

File "/usr/local/lib/python3.5/dist-packages/theano/compile/function.py", line 326, in function
output_keys=output_keys)

File "/usr/local/lib/python3.5/dist-packages/theano/compile/pfunc.py", line 486, in pfunc
output_keys=output_keys)

File "/usr/local/lib/python3.5/dist-packages/theano/compile/function_module.py", line 1807, in orig_function
output_keys=output_keys).create(

File "/usr/local/lib/python3.5/dist-packages/theano/compile/function_module.py", line 1446, in __init__
accept_inplace)

File "/usr/local/lib/python3.5/dist-packages/theano/compile/function_module.py", line 177, in std_fgraph
update_mapping=update_mapping)

File "/usr/local/lib/python3.5/dist-packages/theano/gof/fg.py", line 174, in __init__
self.__import_r__(output, reason="init")

File "/usr/local/lib/python3.5/dist-packages/theano/gof/fg.py", line 345, in __import_r__
self.__import__(variable.owner, reason=reason)

File "/usr/local/lib/python3.5/dist-packages/theano/gof/fg.py", line 390, in __import__
raise MissingInputError(error_msg, variable=r)

MissingInputError: Input 0 of the graph (indices start from 0), used to compute sigmoid(a1_interval__), was not provided and not given a value. Use the Theano flag exception_verbosity='high', for more information on this error.

# Fixed code
def __init__(self, dist, transform, *args, **kwargs):
    """
    Parameters
    ----------
    dist : Distribution
    transform : Transform
    args, kwargs
        arguments to Distribution"""
    forward = transform.forward
    testval = forward(dist.default())
    forward_val = transform.forward_val

    self.dist = dist
    self.transform_used = transform
    v = forward(FreeRV(name="v", distribution=dist))
    self.type = v.type

    super(TransformedDistribution, self).__init__(
        v.shape.tag.test_value, v.dtype, testval, dist.defaults, *args, **kwargs
    )

    if transform.name == "stickbreaking":
        b = np.hstack(((np.atleast_1d(self.shape) == 1)[:-1], False))
        # force the last dim not broadcastable
        self.type = tt.TensorType(v.dtype, b)