Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write TensorFlow code to provide the solutions to the following simple problems: 1 . Declare two constant tensors that have the values of 1 5

Write TensorFlow code to provide the solutions to the following simple problems:
1. Declare two constant tensors that have the values of 15 and 45. Add these two tensors and print
out the results.
2. Declare two variable tensors, a and b, that are initialized with scalar values of 2.75 and 8.5. Find
their product and print out the result.
3. Create two placeholders: x and y - that are both scalars of 32-bit floats. Assign 5.25 to x and 12.6
to y, multiply them together, and print out the results.
4. Create one placeholder: z - that is an N-Dimensional array (N can be >=1) that can have any
shape (shape = None). Feed this vector [1,3,5,7,9] into z and multiply it by 3. Display the
results.
5. Create a constant tensor that is a matrix of the shape (8,8). The matrix is initialized with all
ones (1). Create a variable tensor that is also a matrix of the shape (8,8) and initialized with
random integer values between 0 and 99. Add these two tensors and display the results.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago