码迷,mamicode.com
首页 > 其他好文 > 详细

tensorflow-tf.group

时间:2018-12-16 11:51:47      阅读:340      评论:0      收藏:0      [点我收藏+]

标签:输入   组合   一个   ssi   err   bin   ted   usr   creat   

tf.group
tf.group(
? ? *inputs,
? ? **kwargs
)

创建一个操作,组合多操作。

当该操作完成后,在inputs的所有操作完成,该操作没有输出。

参数:

*inputs: 需要组合的零或多个tensors
name: 操作符的名字(可选)
返回:

一个操作符,能处理所有输入

Raises:

ValueError: 如果提供了unknown关键参数。

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 27 11:16:32 2018
@author: myhaspl
"""

import tensorflow as tf
x1 = tf.random_normal([3,5000],mean=100)
x2 = tf.random_normal([3,5000],mean=100)
x3 = tf.random_normal([3,5000],mean=100)

y1 = tf.sqrt(x1)
y2 = tf.sqrt(x2)
y3 = tf.sqrt(x3)
z = tf.group([y1,y2,y3])

sess=tf.Session()
with sess: 
    sess.run(z)

tensorflow-tf.group

标签:输入   组合   一个   ssi   err   bin   ted   usr   creat   

原文地址:http://blog.51cto.com/13959448/2330992

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!