You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation divides the weighted sum by sqrt(n) or divides by the sqrt(sum(x^2)) if sp_weights are specified on embedding_lookup_sparse.
Also implements math_ops.sparse_segment_sqrtn and its corresponding math_ops.sparse_segment_sqrtn_grad.
Change: 111889513
Copy file name to clipboardExpand all lines: tensorflow/core/ops/ops.pbtxt
+73Lines changed: 73 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7894,6 +7894,79 @@ op {
7894
7894
summary:"Computes gradients for SparseSegmentMean."
7895
7895
description:"Returns tensor \"output\" with same shape as grad, except for dimension 0 whose\nvalue is output_dim0."
7896
7896
}
7897
+
op {
7898
+
name:"SparseSegmentSqrtN"
7899
+
input_arg {
7900
+
name:"data"
7901
+
type_attr:"T"
7902
+
}
7903
+
input_arg {
7904
+
name:"indices"
7905
+
description:"A 1-D tensor. Has same rank as `segment_ids`."
7906
+
type:DT_INT32
7907
+
}
7908
+
input_arg {
7909
+
name:"segment_ids"
7910
+
description:"A 1-D tensor. Values should be sorted and can be repeated."
7911
+
type:DT_INT32
7912
+
}
7913
+
output_arg {
7914
+
name:"output"
7915
+
description:"Has same shape as data, except for dimension 0 which\nhas size `k`, the number of segments."
7916
+
type_attr:"T"
7917
+
}
7918
+
attr {
7919
+
name:"T"
7920
+
type:"type"
7921
+
allowed_values {
7922
+
list {
7923
+
type:DT_FLOAT
7924
+
type:DT_DOUBLE
7925
+
}
7926
+
}
7927
+
}
7928
+
summary:"Computes the sum along sparse segments of a tensor divided by the sqrt of N."
7929
+
description:"N is the size of the segment being reduced.\n\nRead [the section on\nSegmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation\nof segments."
7930
+
}
7931
+
op {
7932
+
name:"SparseSegmentSqrtNGrad"
7933
+
input_arg {
7934
+
name:"grad"
7935
+
description:"gradient propagated to the SparseSegmentSqrtN op."
7936
+
type_attr:"T"
7937
+
}
7938
+
input_arg {
7939
+
name:"indices"
7940
+
description:"indices passed to the corresponding SparseSegmentSqrtN op."
7941
+
type:DT_INT32
7942
+
}
7943
+
input_arg {
7944
+
name:"segment_ids"
7945
+
description:"segment_ids passed to the corresponding SparseSegmentSqrtN op."
7946
+
type:DT_INT32
7947
+
}
7948
+
input_arg {
7949
+
name:"output_dim0"
7950
+
description:"dimension 0 of \"data\" passed to SparseSegmentSqrtN op."
7951
+
type:DT_INT32
7952
+
}
7953
+
output_arg {
7954
+
name:"output"
7955
+
type_attr:"T"
7956
+
}
7957
+
attr {
7958
+
name:"T"
7959
+
type:"type"
7960
+
allowed_values {
7961
+
list {
7962
+
type:DT_FLOAT
7963
+
type:DT_DOUBLE
7964
+
}
7965
+
}
7966
+
}
7967
+
summary:"Computes gradients for SparseSegmentSqrtN."
7968
+
description:"Returns tensor \"output\" with same shape as grad, except for dimension 0 whose\nvalue is output_dim0."
0 commit comments