提交 5d1b70a1 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

changed comments related to deprecated Value class

上级 9c3f95cc
...@@ -44,7 +44,7 @@ class OpFromGraph(gof.Op): ...@@ -44,7 +44,7 @@ class OpFromGraph(gof.Op):
if 'updates' in kwargs: if 'updates' in kwargs:
raise TypeError('updates are not allowed in kwargs') raise TypeError('updates are not allowed in kwargs')
# TODO: the graph may have implicit inputs like Value and # TODO: the graph may have implicit inputs like
# SharedVariable instances. # SharedVariable instances.
# what impact to they have on the validity of this Op? # what impact to they have on the validity of this Op?
self.fn = orig_function(inputs, outputs, **kwargs) self.fn = orig_function(inputs, outputs, **kwargs)
......
...@@ -477,10 +477,7 @@ def pfunc(params, outputs=None, mode=None, updates=None, givens=None, ...@@ -477,10 +477,7 @@ def pfunc(params, outputs=None, mode=None, updates=None, givens=None,
def _pfunc_param_to_in(param, strict=False, allow_downcast=None): def _pfunc_param_to_in(param, strict=False, allow_downcast=None):
if isinstance(param, Constant): if isinstance(param, Constant):
raise TypeError('Constants not allowed in param list', param) raise TypeError('Constants not allowed in param list', param)
#if isinstance(param, Value): if isinstance(param, Variable): # N.B. includes SharedVariable
#return In(variable=param)
#raise NotImplementedError()
if isinstance(param, Variable): # N.B. includes Value and SharedVariable
return In(variable=param, strict=strict, allow_downcast=allow_downcast) return In(variable=param, strict=strict, allow_downcast=allow_downcast)
elif isinstance(param, Param): elif isinstance(param, Param):
return In( return In(
......
...@@ -28,7 +28,7 @@ class Env(utils.object2): ...@@ -28,7 +28,7 @@ class Env(utils.object2):
""" WRITEME """ WRITEME
An Env represents a subgraph bound by a set of input variables and a An Env represents a subgraph bound by a set of input variables and a
set of output variables. The inputs list should contain all the inputs set of output variables. The inputs list should contain all the inputs
on which the outputs depend. Variables of type Value or Constant are on which the outputs depend. Variables of type Constant are
not counted as inputs. not counted as inputs.
The Env supports the replace operation which allows to replace a The Env supports the replace operation which allows to replace a
......
...@@ -217,8 +217,6 @@ class Variable(utils.object2): ...@@ -217,8 +217,6 @@ class Variable(utils.object2):
- `Variable` (this base type) is typically the output of a symbolic computation, - `Variable` (this base type) is typically the output of a symbolic computation,
- `Value` (a subclass) adds a default :literal:`value`, and requires that owner is None
- `Constant` (a subclass) which adds a default and un-replaceable :literal:`value`, and - `Constant` (a subclass) which adds a default and un-replaceable :literal:`value`, and
requires that owner is None requires that owner is None
...@@ -396,6 +394,7 @@ class Constant(Value): ...@@ -396,6 +394,7 @@ class Constant(Value):
if len(name) > 20: if len(name) > 20:
name = name[:10] + '...' + name[-10] name = name[:10] + '...' + name[-10]
return 'Constant{%s}' % name return 'Constant{%s}' % name
def clone(self): def clone(self):
""" """
We clone this object, but we don't clone the data to lower memory requirement We clone this object, but we don't clone the data to lower memory requirement
......
...@@ -212,17 +212,6 @@ def constant(x, name=None): ...@@ -212,17 +212,6 @@ def constant(x, name=None):
except TypeError: except TypeError:
raise TypeError("Could not convert %s to SparseType" % x, type(x)) raise TypeError("Could not convert %s to SparseType" % x, type(x))
if 0:
def value(x):
if not isinstance(x, scipy.sparse.spmatrix):
raise TypeError("sparse.value must be called on a "
"scipy.sparse.spmatrix")
try:
return SparseValue(SparseType(format=x.format,
dtype=x.dtype), x)
except TypeError:
raise TypeError("Could not convert %s to SparseType" % x, type(x))
def sp_ones_like(x): def sp_ones_like(x):
# TODO: don't restrict to CSM formats # TODO: don't restrict to CSM formats
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论