Skip to content

Commit 4941629

Browse files
author
Amit Patankar
authored
Merge branch 'r1.1' into r1.1-tensorboard-run-filter-fix
2 parents 84e38ed + 10ec24a commit 4941629

File tree

4 files changed

+43
-58
lines changed

4 files changed

+43
-58
lines changed

tensorflow/core/ops/math_ops.cc

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,8 +1396,8 @@ REGISTER_OP("SegmentSum")
13961396
.Doc(R"doc(
13971397
Computes the sum along segments of a tensor.
13981398
1399-
Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation)
1400-
for an explanation of segments.
1399+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1400+
segments.
14011401
14021402
Computes a tensor such that
14031403
\\(output_i = \sum_j data_j\\) where sum is over `j` such
@@ -1406,7 +1406,7 @@ that `segment_ids[j] == i`.
14061406
If the sum is empty for a given segment ID `i`, `output[i] = 0`.
14071407
14081408
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
1409-
<img style="width:100%" src="../../images/SegmentSum.png" alt>
1409+
<img style="width:100%" src="https://www.tensorflow.org/images/SegmentSum.png" alt>
14101410
</div>
14111411
14121412
segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s
@@ -1426,9 +1426,8 @@ REGISTER_OP("SegmentMean")
14261426
.Doc(R"doc(
14271427
Computes the mean along segments of a tensor.
14281428
1429-
Read [the section on
1430-
Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
1431-
of segments.
1429+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1430+
segments.
14321431
14331432
Computes a tensor such that
14341433
\\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is
@@ -1438,7 +1437,7 @@ values summed.
14381437
If the mean is empty for a given segment ID `i`, `output[i] = 0`.
14391438
14401439
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
1441-
<img style="width:100%" src="../../images/SegmentMean.png" alt>
1440+
<img style="width:100%" src="https://www.tensorflow.org/images/SegmentMean.png" alt>
14421441
</div>
14431442
14441443
segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s
@@ -1458,9 +1457,8 @@ REGISTER_OP("SegmentProd")
14581457
.Doc(R"doc(
14591458
Computes the product along segments of a tensor.
14601459
1461-
Read [the section on
1462-
Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
1463-
of segments.
1460+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1461+
segments.
14641462
14651463
Computes a tensor such that
14661464
\\(output_i = \prod_j data_j\\) where the product is over `j` such
@@ -1469,7 +1467,7 @@ that `segment_ids[j] == i`.
14691467
If the product is empty for a given segment ID `i`, `output[i] = 1`.
14701468
14711469
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
1472-
<img style="width:100%" src="../../images/SegmentProd.png" alt>
1470+
<img style="width:100%" src="https://www.tensorflow.org/images/SegmentProd.png" alt>
14731471
</div>
14741472
14751473
segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s
@@ -1489,9 +1487,8 @@ REGISTER_OP("SegmentMin")
14891487
.Doc(R"doc(
14901488
Computes the minimum along segments of a tensor.
14911489
1492-
Read [the section on
1493-
Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
1494-
of segments.
1490+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1491+
segments.
14951492
14961493
Computes a tensor such that
14971494
\\(output_i = \min_j(data_j)\\) where `min` is over `j` such
@@ -1500,7 +1497,7 @@ that `segment_ids[j] == i`.
15001497
If the min is empty for a given segment ID `i`, `output[i] = 0`.
15011498
15021499
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
1503-
<img style="width:100%" src="../../images/SegmentMin.png" alt>
1500+
<img style="width:100%" src="https://www.tensorflow.org/images/SegmentMin.png" alt>
15041501
</div>
15051502
15061503
segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s
@@ -1520,8 +1517,8 @@ REGISTER_OP("SegmentMax")
15201517
.Doc(R"doc(
15211518
Computes the maximum along segments of a tensor.
15221519
1523-
Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation)
1524-
for an explanation of segments.
1520+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1521+
segments.
15251522
15261523
Computes a tensor such that
15271524
\\(output_i = \max_j(data_j)\\) where `max` is over `j` such
@@ -1530,7 +1527,7 @@ that `segment_ids[j] == i`.
15301527
If the max is empty for a given segment ID `i`, `output[i] = 0`.
15311528
15321529
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
1533-
<img style="width:100%" src="../../images/SegmentMax.png" alt>
1530+
<img style="width:100%" src="https://www.tensorflow.org/images/SegmentMax.png" alt>
15341531
</div>
15351532
15361533
segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s
@@ -1551,9 +1548,8 @@ REGISTER_OP("UnsortedSegmentSum")
15511548
.Doc(R"doc(
15521549
Computes the sum along segments of a tensor.
15531550
1554-
Read [the section on
1555-
Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
1556-
of segments.
1551+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1552+
segments.
15571553
15581554
Computes a tensor such that
15591555
`(output[i] = sum_{j...} data[j...]` where the sum is over tuples `j...` such
@@ -1566,7 +1562,7 @@ If the sum is empty for a given segment ID `i`, `output[i] = 0`.
15661562
`num_segments` should equal the number of distinct segment IDs.
15671563
15681564
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
1569-
<img style="width:100%" src="../../images/UnsortedSegmentSum.png" alt>
1565+
<img style="width:100%" src="https://www.tensorflow.org/images/UnsortedSegmentSum.png" alt>
15701566
</div>
15711567
15721568
segment_ids: A tensor whose shape is a prefix of `data.shape`.
@@ -1577,7 +1573,6 @@ output: Has same shape as data, except for the first `segment_ids.rank`
15771573
15781574
)doc");
15791575

1580-
15811576
REGISTER_OP("UnsortedSegmentMax")
15821577
.Input("data: T")
15831578
.Input("segment_ids: Tindices")
@@ -1589,11 +1584,10 @@ REGISTER_OP("UnsortedSegmentMax")
15891584
.Doc(R"doc(
15901585
Computes the Max along segments of a tensor.
15911586
1592-
Read [the section on
1593-
Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
1594-
of segments.
1587+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1588+
segments.
15951589
1596-
This operator is similar to the [unsorted segment sum operator](../../api_docs/python/math_ops.md#UnsortedSegmentSum).
1590+
This operator is similar to the [unsorted segment sum operator](../../../api_docs/python/math_ops.md#UnsortedSegmentSum).
15971591
Instead of computing the sum over segments, it computes the maximum
15981592
such that:
15991593
@@ -1604,7 +1598,7 @@ If the maximum is empty for a given segment ID `i`, it outputs the smallest poss
16041598
`output[i] = numeric_limits<T>::min()`.
16051599
16061600
<div style="width:70%; margin:auto; margin-bottom:10px; margin-top:20px;">
1607-
<img style="width:100%" src="../../images/UnsortedSegmentSum.png" alt>
1601+
<img style="width:100%" src="https://www.tensorflow.org/images/UnsortedSegmentSum.png" alt>
16081602
</div>
16091603
16101604
segment_ids: A 1-D tensor whose rank is equal to the rank of `data`'s
@@ -1625,9 +1619,8 @@ REGISTER_OP("SparseSegmentSum")
16251619
.Doc(R"doc(
16261620
Computes the sum along sparse segments of a tensor.
16271621
1628-
Read [the section on
1629-
Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
1630-
of segments.
1622+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1623+
segments.
16311624
16321625
Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first
16331626
dimension, selecting a subset of dimension 0, specified by `indices`.
@@ -1674,9 +1667,8 @@ REGISTER_OP("SparseSegmentMean")
16741667
.Doc(R"doc(
16751668
Computes the mean along sparse segments of a tensor.
16761669
1677-
Read [the section on
1678-
Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
1679-
of segments.
1670+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1671+
segments.
16801672
16811673
Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first
16821674
dimension, selecting a subset of dimension 0, specified by `indices`.
@@ -1724,9 +1716,8 @@ Computes the sum along sparse segments of a tensor divided by the sqrt of N.
17241716
17251717
N is the size of the segment being reduced.
17261718
1727-
Read [the section on
1728-
Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
1729-
of segments.
1719+
Read @{$math_ops#segmentation$the section on segmentation} for an explanation of
1720+
segments.
17301721
17311722
indices: A 1-D tensor. Has same rank as `segment_ids`.
17321723

tensorflow/examples/tutorials/estimators/abalone.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,22 @@ def main(unused_argv):
134134

135135
# Instantiate Estimator
136136
nn = tf.contrib.learn.Estimator(model_fn=model_fn, params=model_params)
137-
137+
138+
def get_train_inputs():
139+
x = tf.constant(training_set.data)
140+
y = tf.constant(training_set.target)
141+
return x, y
142+
138143
# Fit
139-
nn.fit(x=training_set.data, y=training_set.target, steps=5000)
144+
nn.fit(input_fn=get_train_inputs, steps=5000)
140145

141146
# Score accuracy
142-
ev = nn.evaluate(x=test_set.data, y=test_set.target, steps=1)
147+
def get_test_inputs():
148+
x = tf.constant(test_set.data)
149+
y = tf.constant(test_set.target)
150+
return x, y
151+
152+
ev = nn.evaluate(input_fn=get_test_inputs, steps=1)
143153
print("Loss: %s" % ev["loss"])
144154
print("Root Mean Squared Error: %s" % ev["rmse"])
145155

tensorflow/tensorboard/components/tf_dashboard_common/tf-multi-checkbox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
// if undefined, default value (enable for first k runs, disable after).
184184
type: Object,
185185
value: TF.URIStorage.getObjectInitializer('runSelectionState', {}),
186+
observer: "_storeRunToIsCheckedMapping",
186187
},
187188
// (Allows state to persist across regex filtering)
188189
outSelected: {
@@ -230,7 +231,6 @@
230231
},
231232
observers: [
232233
"_setIsolatorIcon(runSelectionState, names)",
233-
"_storeRunToIsCheckedMapping(runSelectionState)",
234234
],
235235
_storeRunToIsCheckedMapping: TF.URIStorage.getObjectObserver('runSelectionState', {}),
236236
_makeRegex: function(regex) {

tensorflow/tensorboard/dist/tf-tensorboard.html

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3325,6 +3325,7 @@ <h3>[[name]]</h3>
33253325
// if undefined, default value (enable for first k runs, disable after).
33263326
type: Object,
33273327
value: TF.URIStorage.getObjectInitializer('runSelectionState', {}),
3328+
observer: "_storeRunToIsCheckedMapping",
33283329
},
33293330
// (Allows state to persist across regex filtering)
33303331
outSelected: {
@@ -3373,24 +3374,7 @@ <h3>[[name]]</h3>
33733374
},
33743375
observers: [
33753376
"_setIsolatorIcon(runSelectionState, names)",
3376-
"_storeRunToIsCheckedMappingWithDefault(runSelectionState, namesMatchingRegex)",
33773377
],
3378-
_storeRunToIsCheckedMappingWithDefault() {
3379-
var runSelectionStateIsDefault = Object.keys(this.runSelectionState).length == 0;
3380-
if (runSelectionStateIsDefault || this.namesMatchingRegex == null) {
3381-
return;
3382-
}
3383-
var _this = this;
3384-
var allToggledOn = this.namesMatchingRegex
3385-
.every(function(n) {return _this.runSelectionState[n]});
3386-
var allToggledOff = this.namesMatchingRegex
3387-
.every(function(n) {return !_this.runSelectionState[n]});
3388-
var defaultOff = this.namesMatchingRegex.length > this.maxRunsToEnableByDefault;
3389-
if (defaultOff && allToggledOff || !defaultOff && allToggledOn) {
3390-
this.runSelectionState = {};
3391-
}
3392-
this._storeRunToIsCheckedMapping(this.runSelectionState);
3393-
},
33943378
_storeRunToIsCheckedMapping: TF.URIStorage.getObjectObserver('runSelectionState', {}),
33953379
_makeRegex: function(regex) {
33963380
try {

0 commit comments

Comments
 (0)