# Reference for tf.sparse.to\_dense

**URL:** <https://discuss.ai.google.dev/t/reference-for-tf-sparse-to-dense/29350>\
**Category:** General Discussion\
**Tags:** help\_request\
**Created:** [November 30, 2022, 1:45am UTC](https://discuss.ai.google.dev/t/reference-for-tf-sparse-to-dense/29350 "2022-11-30T01:45:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jefferson\_Deyvis](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/jefferson_deyvis/32/12994_2.png) [@Jefferson\_Deyvis](https://discuss.ai.google.dev/u/Jefferson_Deyvis)\
**Post date:** [November 30, 2022, 1:45am UTC](https://discuss.ai.google.dev/t/reference-for-tf-sparse-to-dense/29350/1 "2022-11-30T01:45:33Z")

</div>

Hello everyone, I’m researching Tensor Decomposition and I want to understand how I transform a dense Tensor into a Sparse Tensor, or how I can transform a Sparse Tensor into a Dense Tensor. then i found the tf.sparse\_to\_dense and I want some math reference for this method, can anyone help me?

---

<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:** [March 21, 2024, 11:11am UTC](https://discuss.ai.google.dev/t/reference-for-tf-sparse-to-dense/29350/3 "2024-03-21T11:11:11Z")

</div>

Hi @Jefferson_Deyvis

Welcome to the TensorFlow Forum!

You can use TensorFlow APIs [tf.sparse.to\_dense()](https://www.tensorflow.org/api_docs/python/tf/sparse/to_dense) to convert a SparseTensor into a dense tensor and [tf.sparse.from\_dense()](https://www.tensorflow.org/api_docs/python/tf/sparse/from_dense) to convert a dense tensor into a sparse tensor.

Please refer to the mentioned links for more detailed understanding in this where some example codes given to describe about the computation. Thank you.
