简体   繁体   English

无法弄清楚如何在张量中使用值

[英]Can't figure out how to use value in tensor

At '?!?' 在 '?!?' below is where I don't know how to initiate getting into variable 'recursion' a sample from a normal distribution with mean equal to the x axis value of 'seed' and scale '1.'. 下面是我不知道如何开始从正态分布的样本中获取变量“递归”,该样本的均值等于“种子”的x轴值和标度“ 1”。

tf.enable_eager_execution()

seed=tf.distributions.Normal(loc=0. , scale=1.).sample()
recursion=tf.distributions.Normal(loc=seed?!? , scale=1.).sample()

Tensorflow 1.10, python3. Tensorflow 1.10,python3。

It just didn't occur to me to simply pass the tensor variable in and find out what happens. 我只是没有想到只是将张量变量传递进去,然后找出发生了什么。 Below is code that works fine, no indexing, like for example 'seed[0]' or 'seed[0:0]' instead of simply 'seed', required: 下面是运行良好的代码,不需要索引,例如“ seed [0]”或“ seed [0:0]”,而不是简单的“ seed”,这是必需的:

tf.enable_eager_execution()

seed=tf.distributions.Normal(loc=0. , scale=1.).sample()
recursion=tf.distributions.Normal(loc=seed , scale=1.).sample()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我不知道如何使用wxpython的BoxSizer - I can't figure out how to use wxpython's BoxSizer 无法弄清楚如何使用2to3 Python转换器 - Can't figure out how to use 2to3 Python converter 无法弄清楚如何使用all()在我的“代码”中工作 - Can't figure out how to use all() to work in my “code” 不知道如何返回输入 - Can't figure out how to return input 无法弄清楚如何修复“列表索引超出范围” - Can't figure out how to fix "list index out of range" 无法弄清楚如何在另一个函数中使用一个函数中的变量 - Python - Can't figure out how to use a variable from one function in another - Python 学习用Python编写代码。 无法弄清楚如何使用基于UDP有效负载的条件 - Learning to code in Python. Can't figure out how to use conditionals based on UDP payload 无法弄清楚如何在pyspark 1.6和python2.7中使用LinearRegression - Can't figure out how to use LinearRegression at pyspark 1.6 & python2.7 无法弄清楚如何使用表达式在 Python 中验证加拿大邮政编码 - Can't figure out how to use expressions to validate a Canadian postal code in Python 我不知道如何从嵌套字典中提取特定的键:值对 - I can't figure out how to extract specific key:value pairs from a nested dictionary
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM