# Gputill performance difference, tf.dataset and tf.In the tenor

**URL:** <https://discuss.ai.google.dev/t/gputill-performance-difference-tf-dataset-and-tf-in-the-tenor/26935>\
**Category:** General Discussion\
**Tags:** datasets, tfdata\
**Created:** [November 2, 2023, 7:04am UTC](https://discuss.ai.google.dev/t/gputill-performance-difference-tf-dataset-and-tf-in-the-tenor/26935 "2023-11-02T07:04:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wonjun\_choi](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/wonjun_choi/32/8179_2.png) [@wonjun\_choi](https://discuss.ai.google.dev/u/wonjun_choi)\
**Post date:** [November 2, 2023, 7:04am UTC](https://discuss.ai.google.dev/t/gputill-performance-difference-tf-dataset-and-tf-in-the-tenor/26935/1 "2023-11-02T07:04:12Z")

</div>

new\_shape = (self.bsz, -1) # The rest of the dimensions are automatically calculated  
data\_reshaped = tf.reshape(sliced\_data, new\_shape)  
data\_transposed = tf.transpose(data\_reshaped)  
self.data = data\_transposed

why tf.dataset.tensor made by from.generation() has much higher gpu till than when i use tf tensor made by just tf.def like above example

---

<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:** [November 20, 2023, 11:26am UTC](https://discuss.ai.google.dev/t/gputill-performance-difference-tf-dataset-and-tf-in-the-tenor/26935/3 "2023-11-20T11:26:40Z")

</div>

Hi @wonjun_choi

Please provide reproducible code with dataset shape to replicate the error and find out the issue. Thank you.

---

<div class="post-metadata">

**Author:** ![wonjun\_choi](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/wonjun_choi/32/8179_2.png) [@wonjun\_choi](https://discuss.ai.google.dev/u/wonjun_choi)\
**Post date:** [February 6, 2024, 2:52am UTC](https://discuss.ai.google.dev/t/gputill-performance-difference-tf-dataset-and-tf-in-the-tenor/26935/5 "2024-02-06T02:52:05Z")

</div>

I solved the problem, but I couldn’t answer. I’m sorry
