Comments (1)
tf.log(tf.float32) --> return tf.float32
And therefore, if x < 0 and with type tf.float32,
tf.log(x) would output nan
See example below
(Pdb) tf.log(-1)
*** TypeError: Value passed to parameter 'x' has DataType int32 not in list of allowed values: float16, bfloat16, float32, float64, complex64, complex128
(Pdb) tf.log(-1+1j)
<tf.Tensor 'Log_2:0' shape=() dtype=complex128>
(Pdb) tf.log(-1.)
<tf.Tensor 'Log_3:0' shape=() dtype=float32>
(Pdb) tf.log(-1.+0)
<tf.Tensor 'Log_4:0' shape=() dtype=float32>
(Pdb) tf.log(-1.+0j)
<tf.Tensor 'Log_5:0' shape=() dtype=complex128>
(Pdb) tf.log(-2.)
<tf.Tensor 'Log_6:0' shape=() dtype=float32>
(Pdb) tf.log(tf.cast(-1.+0j), tf.complex64)
*** TypeError: cast() missing 1 required positional argument: 'dtype'
(Pdb) tf.log(tf.cast(-1.+0j), dtype=tf.complex64)
*** TypeError: cast() missing 1 required positional argument: 'dtype'
(Pdb) tf.log(tf.cast(-1.+0j, dtype=tf.complex64))
<tf.Tensor 'Log_7:0' shape=() dtype=complex64>
(Pdb) sess=tf.InteractiveSession()
(Pdb) sess.run(tf.log(-1))
*** TypeError: Value passed to parameter 'x' has DataType int32 not in list of allowed values: float16, bfloat16, float32, float64, complex64, complex128
(Pdb) sess.run(tf.log(-1.))
nan
from neural-network-quantum-state.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neural-network-quantum-state.