提交 e0468d71 编写于 作者: T Travis CI

Deploy to GitHub Pages: e23c1fee

上级 73fe42fa
# Design Doc: Selected Rows
`SelectedRows` is a kind of sparse tensor data type, which is designed to support `embedding` operators. The gradient of embedding table is a sparse tensor. Only a few rows are non-zero values in that tensor. It is straightforward to represent the sparse tensor by the following sparse tensor data structure:
`SelectedRows` is a type of sparse tensor data type, which is designed to support `embedding` operators. The gradient of embedding table is a sparse tensor. Only a few rows are non-zero values in this tensor. It is straight-forward to represent a sparse tensor by the following sparse tensor data structure:
```cpp
class SelectedRows {
......@@ -11,7 +11,7 @@ class SelectedRows {
};
```
The field `height_` shows the first dimension of `SelectedRows`. The `rows` are the indices of which rows of `SelectedRows` are non-zeros. The `value_` field is an N-dim tensor and shape is `[rows.size() /* NUM_ROWS */, ...]`, which supplies values for each row. The dimension of `SelectedRows` satisfies `[height_] + value_.shape[1:]`.
The field `height_` is the first dimension of `SelectedRows`. The `rows` are the indices of the non-zero rows of `SelectedRows`. The `value_` field is an N-dim tensor of shape `[rows.size() /* NUM_ROWS */, ...]`, which supplies values for each row. The dimension of `SelectedRows` satisfies `[height_] + value_.shape[1:]`.
Suppose that a SelectedRows-typed variable `x` has many rows, but only two of them have values -- row 73 is `[1, 2]` and row 84 is `[3, 4]`, the `SelectedRows` representation would be:
......@@ -25,7 +25,7 @@ x = SelectedRow {
## SelectedRows in Protobuf
`SelectedRows` is a kind of `Variable`. `VarDesc` in protobuf should describe the `SelectedRows` information. Only the tensor dimension of a `SelectedRows` will be described in compile-time since the `rows_` and `value_` are related to training data.
`SelectedRows` is a type of `Variable`. `VarDesc` in protobuf should describe the `SelectedRows` information. Only the tensor dimension of a `SelectedRows` will be described in compile-time because the `rows_` and `value_` are dependent on the training data.
So we use `TensorDesc` to unify `data_type` and `dims`. A LodTensorDesc contains a `TensorDesc` and `lod_level`. The description of `SelectedRows` is a Tensor description.
```proto
......@@ -54,7 +54,7 @@ message VarDesc {
## InferShape for Selected Rows
Just like `LoD` information, `InferShape` method will inference output tensor type as well. The operator should decide whether its output is a `SelectedRows` or `Dense` tensor.
Just like `LoD` information, `InferShape` method will infer the output tensor type as well. The operator should decide whether its output is a `SelectedRows` or `Dense` tensor.
For example, the gradient operator of `TableLookup` will always generate `SelectedRows`. Its `InferShape` method should be like following
......@@ -68,7 +68,7 @@ void TableLookupGrad::InferShape(context) {
## Sparse Operators
There are several operators should be written to support `SelectedRows`. They are:
There are several operators that need to be written to support `SelectedRows`. These are:
1. Operators which generates `SelectedRows` gradient. e.g. Gradient of `TableLookupOp`.
1. Operators which generate `SelectedRows` gradient. e.g. Gradient of `TableLookupOp`.
2. Optimize operators which support `SelectedRows` gradient. e.g. `SGD` or `AdaGrad` for `SelectedRows`. However, there should be only one `SGD` operator. `OpWithKernel::Run` should select a suitable kernel for both `dense` tensor or `SelectedRows`.
......@@ -179,7 +179,7 @@
<div class="section" id="design-doc-selected-rows">
<span id="design-doc-selected-rows"></span><h1>Design Doc: Selected Rows<a class="headerlink" href="#design-doc-selected-rows" title="Permalink to this headline"></a></h1>
<p><code class="docutils literal"><span class="pre">SelectedRows</span></code> is a kind of sparse tensor data type, which is designed to support <code class="docutils literal"><span class="pre">embedding</span></code> operators. The gradient of embedding table is a sparse tensor. Only a few rows are non-zero values in that tensor. It is straightforward to represent the sparse tensor by the following sparse tensor data structure:</p>
<p><code class="docutils literal"><span class="pre">SelectedRows</span></code> is a type of sparse tensor data type, which is designed to support <code class="docutils literal"><span class="pre">embedding</span></code> operators. The gradient of embedding table is a sparse tensor. Only a few rows are non-zero values in this tensor. It is straight-forward to represent a sparse tensor by the following sparse tensor data structure:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">SelectedRows</span> <span class="p">{</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">vector</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span> <span class="n">rows_</span><span class="p">;</span>
......@@ -188,7 +188,7 @@
<span class="p">};</span>
</pre></div>
</div>
<p>The field <code class="docutils literal"><span class="pre">height_</span></code> shows the first dimension of <code class="docutils literal"><span class="pre">SelectedRows</span></code>. The <code class="docutils literal"><span class="pre">rows</span></code> are the indices of which rows of <code class="docutils literal"><span class="pre">SelectedRows</span></code> are non-zeros. The <code class="docutils literal"><span class="pre">value_</span></code> field is an N-dim tensor and shape is <code class="docutils literal"><span class="pre">[rows.size()</span> <span class="pre">/*</span> <span class="pre">NUM_ROWS</span> <span class="pre">*/,</span> <span class="pre">...]</span></code>, which supplies values for each row. The dimension of <code class="docutils literal"><span class="pre">SelectedRows</span></code> satisfies <code class="docutils literal"><span class="pre">[height_]</span> <span class="pre">+</span> <span class="pre">value_.shape[1:]</span></code>.</p>
<p>The field <code class="docutils literal"><span class="pre">height_</span></code> is the first dimension of <code class="docutils literal"><span class="pre">SelectedRows</span></code>. The <code class="docutils literal"><span class="pre">rows</span></code> are the indices of the non-zero rows of <code class="docutils literal"><span class="pre">SelectedRows</span></code>. The <code class="docutils literal"><span class="pre">value_</span></code> field is an N-dim tensor of shape <code class="docutils literal"><span class="pre">[rows.size()</span> <span class="pre">/*</span> <span class="pre">NUM_ROWS</span> <span class="pre">*/,</span> <span class="pre">...]</span></code>, which supplies values for each row. The dimension of <code class="docutils literal"><span class="pre">SelectedRows</span></code> satisfies <code class="docutils literal"><span class="pre">[height_]</span> <span class="pre">+</span> <span class="pre">value_.shape[1:]</span></code>.</p>
<p>Suppose that a SelectedRows-typed variable <code class="docutils literal"><span class="pre">x</span></code> has many rows, but only two of them have values &#8211; row 73 is <code class="docutils literal"><span class="pre">[1,</span> <span class="pre">2]</span></code> and row 84 is <code class="docutils literal"><span class="pre">[3,</span> <span class="pre">4]</span></code>, the <code class="docutils literal"><span class="pre">SelectedRows</span></code> representation would be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="n">SelectedRow</span> <span class="p">{</span>
<span class="n">rows</span> <span class="o">=</span> <span class="p">[</span><span class="mi">73</span><span class="p">,</span> <span class="mi">84</span><span class="p">],</span>
......@@ -198,7 +198,7 @@
</div>
<div class="section" id="selectedrows-in-protobuf">
<span id="selectedrows-in-protobuf"></span><h2>SelectedRows in Protobuf<a class="headerlink" href="#selectedrows-in-protobuf" title="Permalink to this headline"></a></h2>
<p><code class="docutils literal"><span class="pre">SelectedRows</span></code> is a kind of <code class="docutils literal"><span class="pre">Variable</span></code>. <code class="docutils literal"><span class="pre">VarDesc</span></code> in protobuf should describe the <code class="docutils literal"><span class="pre">SelectedRows</span></code> information. Only the tensor dimension of a <code class="docutils literal"><span class="pre">SelectedRows</span></code> will be described in compile-time since the <code class="docutils literal"><span class="pre">rows_</span></code> and <code class="docutils literal"><span class="pre">value_</span></code> are related to training data.
<p><code class="docutils literal"><span class="pre">SelectedRows</span></code> is a type of <code class="docutils literal"><span class="pre">Variable</span></code>. <code class="docutils literal"><span class="pre">VarDesc</span></code> in protobuf should describe the <code class="docutils literal"><span class="pre">SelectedRows</span></code> information. Only the tensor dimension of a <code class="docutils literal"><span class="pre">SelectedRows</span></code> will be described in compile-time because the <code class="docutils literal"><span class="pre">rows_</span></code> and <code class="docutils literal"><span class="pre">value_</span></code> are dependent on the training data.
So we use <code class="docutils literal"><span class="pre">TensorDesc</span></code> to unify <code class="docutils literal"><span class="pre">data_type</span></code> and <code class="docutils literal"><span class="pre">dims</span></code>. A LodTensorDesc contains a <code class="docutils literal"><span class="pre">TensorDesc</span></code> and <code class="docutils literal"><span class="pre">lod_level</span></code>. The description of <code class="docutils literal"><span class="pre">SelectedRows</span></code> is a Tensor description.</p>
<div class="highlight-proto"><div class="highlight"><pre><span></span><span class="kd">message</span> <span class="nc">TensorDesc</span> <span class="p">{</span>
<span class="k">required</span> <span class="n">DataType</span> <span class="na">data_type</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
......@@ -226,7 +226,7 @@ So we use <code class="docutils literal"><span class="pre">TensorDesc</span></co
</div>
<div class="section" id="infershape-for-selected-rows">
<span id="infershape-for-selected-rows"></span><h2>InferShape for Selected Rows<a class="headerlink" href="#infershape-for-selected-rows" title="Permalink to this headline"></a></h2>
<p>Just like <code class="docutils literal"><span class="pre">LoD</span></code> information, <code class="docutils literal"><span class="pre">InferShape</span></code> method will inference output tensor type as well. The operator should decide whether its output is a <code class="docutils literal"><span class="pre">SelectedRows</span></code> or <code class="docutils literal"><span class="pre">Dense</span></code> tensor.</p>
<p>Just like <code class="docutils literal"><span class="pre">LoD</span></code> information, <code class="docutils literal"><span class="pre">InferShape</span></code> method will infer the output tensor type as well. The operator should decide whether its output is a <code class="docutils literal"><span class="pre">SelectedRows</span></code> or <code class="docutils literal"><span class="pre">Dense</span></code> tensor.</p>
<p>For example, the gradient operator of <code class="docutils literal"><span class="pre">TableLookup</span></code> will always generate <code class="docutils literal"><span class="pre">SelectedRows</span></code>. Its <code class="docutils literal"><span class="pre">InferShape</span></code> method should be like following</p>
<div class="highlight-cpp"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="n">TableLookupGrad</span><span class="o">::</span><span class="n">InferShape</span><span class="p">(</span><span class="n">context</span><span class="p">)</span> <span class="p">{</span>
<span class="p">...</span>
......@@ -237,9 +237,9 @@ So we use <code class="docutils literal"><span class="pre">TensorDesc</span></co
</div>
<div class="section" id="sparse-operators">
<span id="sparse-operators"></span><h2>Sparse Operators<a class="headerlink" href="#sparse-operators" title="Permalink to this headline"></a></h2>
<p>There are several operators should be written to support <code class="docutils literal"><span class="pre">SelectedRows</span></code>. They are:</p>
<p>There are several operators that need to be written to support <code class="docutils literal"><span class="pre">SelectedRows</span></code>. These are:</p>
<ol class="simple">
<li>Operators which generates <code class="docutils literal"><span class="pre">SelectedRows</span></code> gradient. e.g. Gradient of <code class="docutils literal"><span class="pre">TableLookupOp</span></code>.</li>
<li>Operators which generate <code class="docutils literal"><span class="pre">SelectedRows</span></code> gradient. e.g. Gradient of <code class="docutils literal"><span class="pre">TableLookupOp</span></code>.</li>
<li>Optimize operators which support <code class="docutils literal"><span class="pre">SelectedRows</span></code> gradient. e.g. <code class="docutils literal"><span class="pre">SGD</span></code> or <code class="docutils literal"><span class="pre">AdaGrad</span></code> for <code class="docutils literal"><span class="pre">SelectedRows</span></code>. However, there should be only one <code class="docutils literal"><span class="pre">SGD</span></code> operator. <code class="docutils literal"><span class="pre">OpWithKernel::Run</span></code> should select a suitable kernel for both <code class="docutils literal"><span class="pre">dense</span></code> tensor or <code class="docutils literal"><span class="pre">SelectedRows</span></code>.</li>
</ol>
</div>
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
# Design Doc: Selected Rows
`SelectedRows` is a kind of sparse tensor data type, which is designed to support `embedding` operators. The gradient of embedding table is a sparse tensor. Only a few rows are non-zero values in that tensor. It is straightforward to represent the sparse tensor by the following sparse tensor data structure:
`SelectedRows` is a type of sparse tensor data type, which is designed to support `embedding` operators. The gradient of embedding table is a sparse tensor. Only a few rows are non-zero values in this tensor. It is straight-forward to represent a sparse tensor by the following sparse tensor data structure:
```cpp
class SelectedRows {
......@@ -11,7 +11,7 @@ class SelectedRows {
};
```
The field `height_` shows the first dimension of `SelectedRows`. The `rows` are the indices of which rows of `SelectedRows` are non-zeros. The `value_` field is an N-dim tensor and shape is `[rows.size() /* NUM_ROWS */, ...]`, which supplies values for each row. The dimension of `SelectedRows` satisfies `[height_] + value_.shape[1:]`.
The field `height_` is the first dimension of `SelectedRows`. The `rows` are the indices of the non-zero rows of `SelectedRows`. The `value_` field is an N-dim tensor of shape `[rows.size() /* NUM_ROWS */, ...]`, which supplies values for each row. The dimension of `SelectedRows` satisfies `[height_] + value_.shape[1:]`.
Suppose that a SelectedRows-typed variable `x` has many rows, but only two of them have values -- row 73 is `[1, 2]` and row 84 is `[3, 4]`, the `SelectedRows` representation would be:
......@@ -25,7 +25,7 @@ x = SelectedRow {
## SelectedRows in Protobuf
`SelectedRows` is a kind of `Variable`. `VarDesc` in protobuf should describe the `SelectedRows` information. Only the tensor dimension of a `SelectedRows` will be described in compile-time since the `rows_` and `value_` are related to training data.
`SelectedRows` is a type of `Variable`. `VarDesc` in protobuf should describe the `SelectedRows` information. Only the tensor dimension of a `SelectedRows` will be described in compile-time because the `rows_` and `value_` are dependent on the training data.
So we use `TensorDesc` to unify `data_type` and `dims`. A LodTensorDesc contains a `TensorDesc` and `lod_level`. The description of `SelectedRows` is a Tensor description.
```proto
......@@ -54,7 +54,7 @@ message VarDesc {
## InferShape for Selected Rows
Just like `LoD` information, `InferShape` method will inference output tensor type as well. The operator should decide whether its output is a `SelectedRows` or `Dense` tensor.
Just like `LoD` information, `InferShape` method will infer the output tensor type as well. The operator should decide whether its output is a `SelectedRows` or `Dense` tensor.
For example, the gradient operator of `TableLookup` will always generate `SelectedRows`. Its `InferShape` method should be like following
......@@ -68,7 +68,7 @@ void TableLookupGrad::InferShape(context) {
## Sparse Operators
There are several operators should be written to support `SelectedRows`. They are:
There are several operators that need to be written to support `SelectedRows`. These are:
1. Operators which generates `SelectedRows` gradient. e.g. Gradient of `TableLookupOp`.
1. Operators which generate `SelectedRows` gradient. e.g. Gradient of `TableLookupOp`.
2. Optimize operators which support `SelectedRows` gradient. e.g. `SGD` or `AdaGrad` for `SelectedRows`. However, there should be only one `SGD` operator. `OpWithKernel::Run` should select a suitable kernel for both `dense` tensor or `SelectedRows`.
......@@ -193,7 +193,7 @@
<div class="section" id="design-doc-selected-rows">
<span id="design-doc-selected-rows"></span><h1>Design Doc: Selected Rows<a class="headerlink" href="#design-doc-selected-rows" title="永久链接至标题"></a></h1>
<p><code class="docutils literal"><span class="pre">SelectedRows</span></code> is a kind of sparse tensor data type, which is designed to support <code class="docutils literal"><span class="pre">embedding</span></code> operators. The gradient of embedding table is a sparse tensor. Only a few rows are non-zero values in that tensor. It is straightforward to represent the sparse tensor by the following sparse tensor data structure:</p>
<p><code class="docutils literal"><span class="pre">SelectedRows</span></code> is a type of sparse tensor data type, which is designed to support <code class="docutils literal"><span class="pre">embedding</span></code> operators. The gradient of embedding table is a sparse tensor. Only a few rows are non-zero values in this tensor. It is straight-forward to represent a sparse tensor by the following sparse tensor data structure:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">SelectedRows</span> <span class="p">{</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">vector</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span> <span class="n">rows_</span><span class="p">;</span>
......@@ -202,7 +202,7 @@
<span class="p">};</span>
</pre></div>
</div>
<p>The field <code class="docutils literal"><span class="pre">height_</span></code> shows the first dimension of <code class="docutils literal"><span class="pre">SelectedRows</span></code>. The <code class="docutils literal"><span class="pre">rows</span></code> are the indices of which rows of <code class="docutils literal"><span class="pre">SelectedRows</span></code> are non-zeros. The <code class="docutils literal"><span class="pre">value_</span></code> field is an N-dim tensor and shape is <code class="docutils literal"><span class="pre">[rows.size()</span> <span class="pre">/*</span> <span class="pre">NUM_ROWS</span> <span class="pre">*/,</span> <span class="pre">...]</span></code>, which supplies values for each row. The dimension of <code class="docutils literal"><span class="pre">SelectedRows</span></code> satisfies <code class="docutils literal"><span class="pre">[height_]</span> <span class="pre">+</span> <span class="pre">value_.shape[1:]</span></code>.</p>
<p>The field <code class="docutils literal"><span class="pre">height_</span></code> is the first dimension of <code class="docutils literal"><span class="pre">SelectedRows</span></code>. The <code class="docutils literal"><span class="pre">rows</span></code> are the indices of the non-zero rows of <code class="docutils literal"><span class="pre">SelectedRows</span></code>. The <code class="docutils literal"><span class="pre">value_</span></code> field is an N-dim tensor of shape <code class="docutils literal"><span class="pre">[rows.size()</span> <span class="pre">/*</span> <span class="pre">NUM_ROWS</span> <span class="pre">*/,</span> <span class="pre">...]</span></code>, which supplies values for each row. The dimension of <code class="docutils literal"><span class="pre">SelectedRows</span></code> satisfies <code class="docutils literal"><span class="pre">[height_]</span> <span class="pre">+</span> <span class="pre">value_.shape[1:]</span></code>.</p>
<p>Suppose that a SelectedRows-typed variable <code class="docutils literal"><span class="pre">x</span></code> has many rows, but only two of them have values &#8211; row 73 is <code class="docutils literal"><span class="pre">[1,</span> <span class="pre">2]</span></code> and row 84 is <code class="docutils literal"><span class="pre">[3,</span> <span class="pre">4]</span></code>, the <code class="docutils literal"><span class="pre">SelectedRows</span></code> representation would be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="n">SelectedRow</span> <span class="p">{</span>
<span class="n">rows</span> <span class="o">=</span> <span class="p">[</span><span class="mi">73</span><span class="p">,</span> <span class="mi">84</span><span class="p">],</span>
......@@ -212,7 +212,7 @@
</div>
<div class="section" id="selectedrows-in-protobuf">
<span id="selectedrows-in-protobuf"></span><h2>SelectedRows in Protobuf<a class="headerlink" href="#selectedrows-in-protobuf" title="永久链接至标题"></a></h2>
<p><code class="docutils literal"><span class="pre">SelectedRows</span></code> is a kind of <code class="docutils literal"><span class="pre">Variable</span></code>. <code class="docutils literal"><span class="pre">VarDesc</span></code> in protobuf should describe the <code class="docutils literal"><span class="pre">SelectedRows</span></code> information. Only the tensor dimension of a <code class="docutils literal"><span class="pre">SelectedRows</span></code> will be described in compile-time since the <code class="docutils literal"><span class="pre">rows_</span></code> and <code class="docutils literal"><span class="pre">value_</span></code> are related to training data.
<p><code class="docutils literal"><span class="pre">SelectedRows</span></code> is a type of <code class="docutils literal"><span class="pre">Variable</span></code>. <code class="docutils literal"><span class="pre">VarDesc</span></code> in protobuf should describe the <code class="docutils literal"><span class="pre">SelectedRows</span></code> information. Only the tensor dimension of a <code class="docutils literal"><span class="pre">SelectedRows</span></code> will be described in compile-time because the <code class="docutils literal"><span class="pre">rows_</span></code> and <code class="docutils literal"><span class="pre">value_</span></code> are dependent on the training data.
So we use <code class="docutils literal"><span class="pre">TensorDesc</span></code> to unify <code class="docutils literal"><span class="pre">data_type</span></code> and <code class="docutils literal"><span class="pre">dims</span></code>. A LodTensorDesc contains a <code class="docutils literal"><span class="pre">TensorDesc</span></code> and <code class="docutils literal"><span class="pre">lod_level</span></code>. The description of <code class="docutils literal"><span class="pre">SelectedRows</span></code> is a Tensor description.</p>
<div class="highlight-proto"><div class="highlight"><pre><span></span><span class="kd">message</span> <span class="nc">TensorDesc</span> <span class="p">{</span>
<span class="k">required</span> <span class="n">DataType</span> <span class="na">data_type</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
......@@ -240,7 +240,7 @@ So we use <code class="docutils literal"><span class="pre">TensorDesc</span></co
</div>
<div class="section" id="infershape-for-selected-rows">
<span id="infershape-for-selected-rows"></span><h2>InferShape for Selected Rows<a class="headerlink" href="#infershape-for-selected-rows" title="永久链接至标题"></a></h2>
<p>Just like <code class="docutils literal"><span class="pre">LoD</span></code> information, <code class="docutils literal"><span class="pre">InferShape</span></code> method will inference output tensor type as well. The operator should decide whether its output is a <code class="docutils literal"><span class="pre">SelectedRows</span></code> or <code class="docutils literal"><span class="pre">Dense</span></code> tensor.</p>
<p>Just like <code class="docutils literal"><span class="pre">LoD</span></code> information, <code class="docutils literal"><span class="pre">InferShape</span></code> method will infer the output tensor type as well. The operator should decide whether its output is a <code class="docutils literal"><span class="pre">SelectedRows</span></code> or <code class="docutils literal"><span class="pre">Dense</span></code> tensor.</p>
<p>For example, the gradient operator of <code class="docutils literal"><span class="pre">TableLookup</span></code> will always generate <code class="docutils literal"><span class="pre">SelectedRows</span></code>. Its <code class="docutils literal"><span class="pre">InferShape</span></code> method should be like following</p>
<div class="highlight-cpp"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="n">TableLookupGrad</span><span class="o">::</span><span class="n">InferShape</span><span class="p">(</span><span class="n">context</span><span class="p">)</span> <span class="p">{</span>
<span class="p">...</span>
......@@ -251,9 +251,9 @@ So we use <code class="docutils literal"><span class="pre">TensorDesc</span></co
</div>
<div class="section" id="sparse-operators">
<span id="sparse-operators"></span><h2>Sparse Operators<a class="headerlink" href="#sparse-operators" title="永久链接至标题"></a></h2>
<p>There are several operators should be written to support <code class="docutils literal"><span class="pre">SelectedRows</span></code>. They are:</p>
<p>There are several operators that need to be written to support <code class="docutils literal"><span class="pre">SelectedRows</span></code>. These are:</p>
<ol class="simple">
<li>Operators which generates <code class="docutils literal"><span class="pre">SelectedRows</span></code> gradient. e.g. Gradient of <code class="docutils literal"><span class="pre">TableLookupOp</span></code>.</li>
<li>Operators which generate <code class="docutils literal"><span class="pre">SelectedRows</span></code> gradient. e.g. Gradient of <code class="docutils literal"><span class="pre">TableLookupOp</span></code>.</li>
<li>Optimize operators which support <code class="docutils literal"><span class="pre">SelectedRows</span></code> gradient. e.g. <code class="docutils literal"><span class="pre">SGD</span></code> or <code class="docutils literal"><span class="pre">AdaGrad</span></code> for <code class="docutils literal"><span class="pre">SelectedRows</span></code>. However, there should be only one <code class="docutils literal"><span class="pre">SGD</span></code> operator. <code class="docutils literal"><span class="pre">OpWithKernel::Run</span></code> should select a suitable kernel for both <code class="docutils literal"><span class="pre">dense</span></code> tensor or <code class="docutils literal"><span class="pre">SelectedRows</span></code>.</li>
</ol>
</div>
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册