提交 973187d4 authored 作者: Frederic's avatar Frederic

fix docstring.

上级 67d3a051
...@@ -2892,8 +2892,9 @@ def extract_constant(x): ...@@ -2892,8 +2892,9 @@ def extract_constant(x):
This function is basically a call to tensor.get_constant_value. The This function is basically a call to tensor.get_constant_value. The
main difference is the behaviour in case of failure. While main difference is the behaviour in case of failure. While
get_constant_value raises an TypeError, this function returns x, get_constant_value raises an TypeError, this function returns x,
as a tensor ( by removing the last scalar_from_tensor ) if needed as a tensor if possible. If x is a ScalarVariable from a
or None if that is the value of x. scalar_from_tensor, we remove the conversion. If x is just a
ScalarVariable, we convert it to a tensor with tensor_from_scalar.
''' '''
try: try:
x = get_constant_value(x) x = get_constant_value(x)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论