#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: Jia ShiLin import tensorflow as tf import numpy as np zero = tf.zeros([2, 3], tf.float32) print(zero) sess = tf.Session() zero.eval(session=sess) #!!!!!!!!万能类型转化函数 a = tf.cast(zero,tf.int32) print(a) b =tf.ones((2,3),tf.float32) c = tf.zeros((2,3),tf.float32) d = tf.concat([b,c],axis=0) print(d)
tensorflow常用变量的定义_运算API.py
最新推荐文章于 2021-01-17 21:21:03 发布