# Writing Tensor Objects to Numpy arrays in Tensorflow 1.12

**URL:** <https://discuss.ai.google.dev/t/writing-tensor-objects-to-numpy-arrays-in-tensorflow-1-12/29871>\
**Category:** General Discussion\
**Tags:** tfcore, help\_request\
**Created:** [December 16, 2021, 12:36pm UTC](https://discuss.ai.google.dev/t/writing-tensor-objects-to-numpy-arrays-in-tensorflow-1-12/29871 "2021-12-16T12:36:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![snehalstomar](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/snehalstomar/32/10019_2.png) [@snehalstomar](https://discuss.ai.google.dev/u/snehalstomar)\
**Post date:** [December 16, 2021, 12:36pm UTC](https://discuss.ai.google.dev/t/writing-tensor-objects-to-numpy-arrays-in-tensorflow-1-12/29871/1 "2021-12-16T12:36:14Z")

</div>

I am building a model which is supposed to be a composition of different models. I need the output of one model to be fed as input to another. To do so, I followed the standard approach of extending tf.keras.Model and modifying the call() function suitably. However, that didn’t work out since Model2 expects an input of the type np.ndarray whereas Model1 returns an output of the type tf.tensor hence their composition isn’t possible.

I have tried multiple ways of doing the above including converting the tensor to a tf.Variable and using the Variable.assign() method, writing out values to a list and then using np.stack() to get a np.tensor as output. Nothing has worked so far.

I request the community to kindly help me out in solving the above issue.

---

<div class="post-metadata">

**Author:** ![Renu\_Patel](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/renu_patel/32/8957_2.png) [@Renu\_Patel](https://discuss.ai.google.dev/u/Renu_Patel)\
**Post date:** [September 29, 2023, 12:44pm UTC](https://discuss.ai.google.dev/t/writing-tensor-objects-to-numpy-arrays-in-tensorflow-1-12/29871/3 "2023-09-29T12:44:10Z")

</div>

Hi @snehalstomar

Welcome to the TensorFlow Forum!

Please share minimal reproducible code to replicate and understand the issue to provide you fix for that. Thank you.
