commit
7c10b24de3
@ -55,7 +55,7 @@ class CompileOnlyService : public Service {
|
|||||||
|
|
||||||
// Override Service methods that require or imply the existence of an
|
// Override Service methods that require or imply the existence of an
|
||||||
// execute backend. Note that this does not include TransferToClient, as
|
// execute backend. Note that this does not include TransferToClient, as
|
||||||
// computing contants produces global data that we may wish to transfer.
|
// computing constants produces global data that we may wish to transfer.
|
||||||
tensorflow::Status Execute(const ExecuteRequest* arg,
|
tensorflow::Status Execute(const ExecuteRequest* arg,
|
||||||
ExecuteResponse* result) override {
|
ExecuteResponse* result) override {
|
||||||
return Unimplemented("CompileOnlyService does not support execution.");
|
return Unimplemented("CompileOnlyService does not support execution.");
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
"""Vectorized Laplace distribution class, directly using LinearOpeartor."""
|
"""Vectorized Laplace distribution class, directly using LinearOperator."""
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
@ -344,7 +344,7 @@ class LuongAttention(_BaseAttentionMechanism):
|
|||||||
# [batch_size, 1, depth] . [batch_size, depth, max_time]
|
# [batch_size, 1, depth] . [batch_size, depth, max_time]
|
||||||
# resulting in an output shape of:
|
# resulting in an output shape of:
|
||||||
# [batch_time, 1, max_time].
|
# [batch_time, 1, max_time].
|
||||||
# we then squeee out the center singleton dimension.
|
# we then squeeze out the center singleton dimension.
|
||||||
score = math_ops.matmul(query, self.keys, transpose_b=True)
|
score = math_ops.matmul(query, self.keys, transpose_b=True)
|
||||||
score = array_ops.squeeze(score, [1])
|
score = array_ops.squeeze(score, [1])
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ Status AddDefaultAttrsToGraphDef(GraphDef* graph_def,
|
|||||||
// attr with a default was added). Note that this will not affect
|
// attr with a default was added). Note that this will not affect
|
||||||
// attrs with non-default values, so you must run a
|
// attrs with non-default values, so you must run a
|
||||||
// ValidateGraphDef...() function to see if the result is in fact
|
// ValidateGraphDef...() function to see if the result is in fact
|
||||||
// compatible. If not nulllptr, the op/attr pairs that were removed
|
// compatible. If not nullptr, the op/attr pairs that were removed
|
||||||
// are added to '*op_attr_removed'.
|
// are added to '*op_attr_removed'.
|
||||||
//
|
//
|
||||||
// Expected usage, for a producer that wants to prepare a graph for
|
// Expected usage, for a producer that wants to prepare a graph for
|
||||||
|
@ -28,7 +28,7 @@ namespace grappler {
|
|||||||
const char kConstantFoldingConst[] = "ConstantFolding";
|
const char kConstantFoldingConst[] = "ConstantFolding";
|
||||||
const char kConstantFoldingCtrl[] = "ConstantFoldingCtrl";
|
const char kConstantFoldingCtrl[] = "ConstantFoldingCtrl";
|
||||||
|
|
||||||
// Contant folding optimization for a graph.
|
// Constant folding optimization for a graph.
|
||||||
class ConstantFolding : public GraphOptimizer {
|
class ConstantFolding : public GraphOptimizer {
|
||||||
public:
|
public:
|
||||||
ConstantFolding();
|
ConstantFolding();
|
||||||
|
@ -927,7 +927,7 @@ struct TuningConfig {
|
|||||||
// Conv2DBackpropFilter will use a specialized GEMM implementation, which is
|
// Conv2DBackpropFilter will use a specialized GEMM implementation, which is
|
||||||
// usually faster than the NCHW implementation. The downside is that this
|
// usually faster than the NCHW implementation. The downside is that this
|
||||||
// might result in more non-cancellable layout conversion nodes (implemented
|
// might result in more non-cancellable layout conversion nodes (implemented
|
||||||
// by the Tranpose op).
|
// by the Transpose op).
|
||||||
bool no_gemm;
|
bool no_gemm;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -988,9 +988,9 @@ def index_table_from_tensor(vocabulary_list,
|
|||||||
Sample Usages:
|
Sample Usages:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
vocabulary_list = t.constant(["emerson", "lake", "palmer")
|
vocabulary_list = tf.constant(["emerson", "lake", "palmer"])
|
||||||
table = tf.contrib.lookup.index_table_from_tensor(
|
table = tf.contrib.lookup.index_table_from_tensor(
|
||||||
vocabulary_list=vocabulary_list, num_oov_buckets=1, default_value=-1)
|
mapping=vocabulary_list, num_oov_buckets=1, default_value=-1)
|
||||||
features = tf.constant(["emerson", "lake", "and", "palmer"])
|
features = tf.constant(["emerson", "lake", "and", "palmer"])
|
||||||
ids = table.lookup(features)
|
ids = table.lookup(features)
|
||||||
...
|
...
|
||||||
@ -1160,7 +1160,7 @@ def index_to_string_table_from_tensor(vocabulary_list,
|
|||||||
Sample Usages:
|
Sample Usages:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
vocabulary_list = t.constant(["emerson", "lake", "palmer")
|
vocabulary_list = tf.constant(["emerson", "lake", "palmer"])
|
||||||
indices = tf.constant([1, 5], tf.int64)
|
indices = tf.constant([1, 5], tf.int64)
|
||||||
table = tf.contrib.lookup.index_to_string_table_from_tensor(
|
table = tf.contrib.lookup.index_to_string_table_from_tensor(
|
||||||
vocabulary_list, default_value="UNKNOWN")
|
vocabulary_list, default_value="UNKNOWN")
|
||||||
|
Loading…
Reference in New Issue
Block a user