数学公式API:https://github.com/tensorflow/docs/blob/master/site/en/api_guides/python
constant
a = tf.constant(0, name='B') |
常量
x = tf.zeros([2, 3], tf.int32) |
变量
with tf.variable_scope('meh') as scope: |
placeholdder占位符
input1 = tf.placeholder(tf.float32) |
类型转换
tf.cast(tf.constant(2.0), tf.int32) |
把numpy转换成Tensor
import numpy as np |