What is tf unstack

This recipe explains what is tf unstack

Recipe Objective

What is tf.unstack?

This will unpacks the given dimension of rank for e.g "R" tensor into rank e.g "(R-1)" tensors. The function by chipping it along with the axis dimension unpacks the tensor from the value. It is inferred from the values's shape when the tensor is not specified. The error "ValueError" is raised if the "value.shape[axis]" is not known. Lets say we have tensor of shape (W, X, Y, Z): If the axis == 0 then the i'th tensor is the output which is the slice value[i, :, :, :] and each tensor in output will have the shape is (X, Y, Z) also if the axis == 1 then the i'th tensor is the output which is the slice value[:, i, :, :] and each tensor in output will have the shape is (W, Y, Z). etc.

Access YOLO OCR Character Recognition Project with Source Code

Step 1 - Import library

import tensorflow as tf

Step 2 - Take Sample data

A = tf.constant([9,8]) B = tf.constant([7,6]) C = tf.constant([4,3])

Step 3 - Perform Unstack

unstack = tf.unstack([A, B, C]) unstack

[,
 ,
 ]

What Users are saying..

profile image

Gautam Vermani

Data Consultant at Confidential
linkedin profile url

Having worked in the field of Data Science, I wanted to explore how I can implement projects in other domains, So I thought of connecting with ProjectPro. A project that helped me absorb this topic... Read More

Relevant Projects

Detectron2 Object Detection and Segmentation Example Python
Object Detection using Detectron2 - Build a Dectectron2 model to detect the zones and inhibitions in antibiogram images.

Build OCR from Scratch Python using YOLO and Tesseract
In this deep learning project, you will learn how to build your custom OCR (optical character recognition) from scratch by using Google Tesseract and YOLO to read the text from any images.

Build a CNN Model with PyTorch for Image Classification
In this deep learning project, you will learn how to build an Image Classification Model using PyTorch CNN

Build Portfolio Optimization Machine Learning Models in R
Machine Learning Project for Financial Risk Modelling and Portfolio Optimization with R- Build a machine learning model in R to develop a strategy for building a portfolio for maximized returns.

Learn Object Tracking (SOT, MOT) using OpenCV and Python
Get Started with Object Tracking using OpenCV and Python - Learn to implement Multiple Instance Learning Tracker (MIL) algorithm, Generic Object Tracking Using Regression Networks Tracker (GOTURN) algorithm, Kernelized Correlation Filters Tracker (KCF) algorithm, Tracking, Learning, Detection Tracker (TLD) algorithm for single and multiple object tracking from various video clips.

End-to-End ML Model Monitoring using Airflow and Docker
In this MLOps Project, you will learn to build an end to end pipeline to monitor any changes in the predictive power of model or degradation of data.

MLOps AWS Project on Topic Modeling using Gunicorn Flask
In this project we will see the end-to-end machine learning development process to design, build and manage reproducible, testable, and evolvable machine learning models by using AWS

Classification Projects on Machine Learning for Beginners - 1
Classification ML Project for Beginners - A Hands-On Approach to Implementing Different Types of Classification Algorithms in Machine Learning for Predictive Modelling

NLP Project to Build a Resume Parser in Python using Spacy
Use the popular Spacy NLP python library for OCR and text classification to build a Resume Parser in Python.

Build CNN Image Classification Models for Real Time Prediction
Image Classification Project to build a CNN model in Python that can classify images into social security cards, driving licenses, and other key identity information.