# R.V. is forgotten after the def

**URL:** <https://discourse.pymc.io/t/r-v-is-forgotten-after-the-def/4870>\
**Category:** Questions\
**Created:** [April 15, 2020, 4:18am UTC](https://discourse.pymc.io/t/r-v-is-forgotten-after-the-def/4870 "2020-04-15T04:18:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aakhmetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/aakhmetz/32/1500_2.png) [@aakhmetz](https://discourse.pymc.io/u/aakhmetz)\
**Post date:** [April 15, 2020, 4:18am UTC](https://discourse.pymc.io/t/r-v-is-forgotten-after-the-def/4870/1 "2020-04-15T04:18:43Z")

</div>

Dear all,

I am a bit confused, but I am probably wrong. If I run the following code:

```python
def getΔ(m):
    with m:
        Δ = pm.Laplace('Δ', 0, 10, shape = [4, 5])
        tt.printing.Print('Δ')(Δ.shape)
    return True

model = pm.Model()
with model:
    getΔ(model)
    tt.printing.Print('Δ')(Δ.shape)
    pm.sample(100)

```

I get the output:

```auto
Δ __str__ = [4 5]
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-10-e0419021930f> in <module>
      8 with model:
      9 getΔ(model)
---> 10 tt.printing.Print('Δ')(Δ.shape)
     11 pm.sample(100)

NameError: name 'Δ' is not defined

```

Was it correct to assume that Δ should still be present even if I don’t return it with the def?

---

<div class="post-metadata">

**Author:** ![aseyboldt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/aseyboldt/32/5795_2.png) [@aseyboldt](https://discourse.pymc.io/u/aseyboldt)\
**Post date:** [April 15, 2020, 8:23am UTC](https://discourse.pymc.io/t/r-v-is-forgotten-after-the-def/4870/2 "2020-04-15T08:23:09Z")

</div>

It is added to the model, so it would show up in the trace. You still have to explicitly return the reference using the normal python rules to access them within the model.
