提交 01eb03d4 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

subtensor doc

上级 971e1302
...@@ -3802,7 +3802,7 @@ class AdvancedIndexingError(TypeError): ...@@ -3802,7 +3802,7 @@ class AdvancedIndexingError(TypeError):
class Subtensor(Op): class Subtensor(Op):
"""Return a subtensor view """Return a subtensor view
The inputs array is the tensor x, followed by scalar integer variables. The inputs array is the tensor x, followed by scalar integer types.
TODO: WRITEME: how are the scalar integer variables formatted? TODO: WRITEME: how are the scalar integer variables formatted?
This class uses a relatively complex internal representation of the inputs This class uses a relatively complex internal representation of the inputs
...@@ -3811,7 +3811,7 @@ class Subtensor(Op): ...@@ -3811,7 +3811,7 @@ class Subtensor(Op):
idx_list: instance variable TODO: WRITEME: is this a list or a tuple? idx_list: instance variable TODO: WRITEME: is this a list or a tuple?
(old docstring gives two conflicting (old docstring gives two conflicting
descriptions) descriptions)
elements are either integers, theano scalars, or slices. elements are either integers, theano scalar types, or slices.
one element per "explicitly named dimension" one element per "explicitly named dimension"
TODO: WRITEME: what is an "explicitly named dimension" ? TODO: WRITEME: what is an "explicitly named dimension" ?
...@@ -3820,7 +3820,11 @@ class Subtensor(Op): ...@@ -3820,7 +3820,11 @@ class Subtensor(Op):
if slice: if slice:
start/stop/step members of each slice are integer indices start/stop/step members of each slice are integer indices
into the inputs array or None into the inputs array or None
integer indices be actual integers or theano scalars integer indices be actual integers or theano scalar types
Note that the idx_list defines the Op, so two Subtensor instances are
considered to be different Ops if they have different idx_list fields.
This means that the entries in it are theano Types, not theano Variables.
@todo: add support for advanced tensor indexing (in Subtensor_dx too). @todo: add support for advanced tensor indexing (in Subtensor_dx too).
...@@ -3868,9 +3872,12 @@ class Subtensor(Op): ...@@ -3868,9 +3872,12 @@ class Subtensor(Op):
@staticmethod @staticmethod
def convert(entry, slice_ok=True): def convert(entry, slice_ok=True):
""" """
TODO: WRITEME The "idx_list" field is unique to each Subtensor instance.
TODO: In particular, wtf does it mean to have a Type instead of a Variable It is not unique to each Apply node, so it should not refer to
in here? specific Variables. This method changes references to Variables
into references to Types.
TODO: WRITEME: This method also accepts "entry" already being a Type;
when would that happen?
""" """
invalid_scal_types = [scal.float64, scal.float32] invalid_scal_types = [scal.float64, scal.float32]
scal_types = [scal.int64, scal.int32, scal.int16, scal.int8] scal_types = [scal.int64, scal.int32, scal.int16, scal.int8]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论