Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherrypicks for 1.1 #9345

Merged
merged 2 commits into from Apr 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tensorflow/python/kernel_tests/bincount_op_test.py
Expand Up @@ -73,13 +73,13 @@ def test_random_with_weights(self):
else:
weights = np.random.random(num_samples)
self.assertAllEqual(
math_ops.bincount(arr, weights=weights).eval(),
math_ops.bincount(arr, weights).eval(),
np.bincount(arr, weights))

def test_zero_weights(self):
with self.test_session():
self.assertAllEqual(
math_ops.bincount(np.arange(1000), weights=np.zeros(1000)).eval(),
math_ops.bincount(np.arange(1000), np.zeros(1000)).eval(),
np.zeros(1000))

def test_negative(self):
Expand Down
8 changes: 4 additions & 4 deletions tensorflow/python/ops/math_ops.py
Expand Up @@ -2026,9 +2026,9 @@ def tanh(x, name=None):


def bincount(arr,
weights=None,
minlength=None,
maxlength=None,
weights=None,
dtype=dtypes.int32):
"""Counts the number of occurrences of each value in an integer array.

Expand All @@ -2040,13 +2040,13 @@ def bincount(arr,

Args:
arr: An int32 tensor of non-negative values.
weights: If non-None, must be the same shape as arr. For each value in
`arr`, the bin will be incremented by the corresponding weight instead
of 1.
minlength: If given, ensures the output has length at least `minlength`,
padding with zeros at the end if necessary.
maxlength: If given, skips values in `arr` that are equal or greater than
`maxlength`, ensuring that the output has length at most `maxlength`.
weights: If non-None, must be the same shape as arr. For each value in
`arr`, the bin will be incremented by the corresponding weight instead
of 1.
dtype: If `weights` is None, determines the type of the output bins.

Returns:
Expand Down
52 changes: 36 additions & 16 deletions tensorflow/tensorboard/dist/tf-tensorboard.html
Expand Up @@ -4582,7 +4582,7 @@ <h3 id="tooltip-help" class="tooltip-container">
// If b===a, we would create an empty range. We instead select the range
// [0, 2*a] if a > 0, or [-2*a, 0] if a < 0, plus a little bit of
// extra padding on the top and bottom of the plot.
padding = Math.abs(a) * 1.1;
padding = Math.abs(a) * 1.1 + 1.1;
}
else {
padding = span * 0.2;
Expand Down Expand Up @@ -5332,7 +5332,7 @@ <h3 id="tooltip-help" class="tooltip-container">
// If b===a, we would create an empty range. We instead select the range
// [0, 2*a] if a > 0, or [-2*a, 0] if a < 0, plus a little bit of
// extra padding on the top and bottom of the plot.
padding = Math.abs(a) * 1.1;
padding = Math.abs(a) * 1.1 + 1.1;
}
else {
padding = span * 0.2;
Expand Down Expand Up @@ -17812,11 +17812,14 @@ <h2>
properties: {
_datasets: Object,
_renderHierarchy: {type: Object, observer: '_renderHierarchyChanged'},
backend: {type: Object, observer: '_backendChanged'},
backend: Object,
debuggerDataEnabled: Boolean,
allStepsModeEnabled: Boolean,
specificHealthPillStep: {type: Number, value: 0},
healthPillsToggledOn: {type: Boolean, value: true, observer: '_healthPillsToggledOnChanged'},
_isAttached: Boolean,
// Whether this dashboard is initialized. This dashboard should only be initialized once.
_initialized: Boolean,
// Whether health pills are currently being loaded, in which case we may want to say show a
// spinner.
_areHealthPillsLoading: Boolean,
Expand Down Expand Up @@ -17845,7 +17848,14 @@ <h2>
},
observers: [
'_maybeFetchHealthPillsAtSpecificStep(allStepsModeEnabled, specificHealthPillStep)',
'_maybeInitializeDashboard(backend, _isAttached)',
],
attached: function() {
this.set('_isAttached', true);
},
detached: function() {
this.set('_isAttached', false);
},
reload: function() {
if (!this.debuggerDataEnabled ||
!this.healthPillsToggledOn ||
Expand All @@ -17861,7 +17871,14 @@ <h2>
// would not change across reloads.
this._requestHealthPills();
},
_backendChanged: function(backend) {
_maybeInitializeDashboard: function(backend, isAttached) {
if (this._initialized || !backend || !isAttached) {
// Either this dashboard is already initialized ... or we are not yet ready to initialize.
return;
}

// Set this to true so we only initialize once.
this._initialized = true;
Promise.all([backend.graphRuns(), backend.runMetadataRuns()])
.then(function(result) {
var runsWithGraph = result[0].sort(VZ.Sorting.compareTagNames);
Expand Down Expand Up @@ -18846,6 +18863,7 @@ <h4><span class="step-label">Step 1:</span> Make data public</h4>
</p>
<p>
One option is using a <a target="_blank" href="https://gist.github.com/">github gist</a>.
If you choose this approach, make sure to link directly to the raw file.
</p>
</div>
<div>
Expand Down Expand Up @@ -19822,23 +19840,25 @@ <h3>2D controls</h3>
},
properties: {
dataNotFound: Boolean,
routePrefix: String
routePrefix: String,
// Whether this dashboard is initialized. This dashboard should only be initialized once.
_initialized: Boolean,
},
behaviors: [
TF.Dashboard.DashboardBehavior("embeddings"),
],
observers: [
"_routePrefixSet(routePrefix)",
],
reload: function() {
// Do not reload the embedding projector. Reloading could take a long time.
},
_routePrefixSet: function(routePrefix) {
if (routePrefix === undefined) {
// The route prefix has not been set yet.
attached: function() {
if (this._initialized) {
return;
}
d3.json(routePrefix + '/runs', (err, runs) => {

// Set this to true so we only initialize once.
this._initialized = true;

d3.json(this.routePrefix + '/runs', (err, runs) => {
this.set('dataNotFound', runs.length === 0);
});
},
Expand Down Expand Up @@ -25619,8 +25639,8 @@ <h2>Settings</h2>
embeddings: [{
tensorName: 'My tensor',
tensorShape: [1000, 50],
tensorPath: 'https://gist.github.com/.../tensors.tsv',
metadataPath: 'https://gist.github.com/.../optional.metadata.tsv',
tensorPath: 'https://raw.githubusercontent.com/.../tensors.tsv',
metadataPath: 'https://raw.githubusercontent.com/.../optional.metadata.tsv',
}],
};
this.setProjectorConfigTemplateJson(projectorConfigTemplate, projectorConfigTemplateJson);
Expand All @@ -25642,7 +25662,7 @@ <h2>Settings</h2>
bookmarksFieldCheckbox.addEventListener('change', function () {
if (bookmarksFieldCheckbox.checked) {
projectorConfigTemplateJson.embeddings[0].bookmarksPath =
'https://gist.github.com/.../bookmarks.txt';
'https://raw.githubusercontent.com/.../bookmarks.txt';
}
else {
delete projectorConfigTemplateJson.embeddings[0].bookmarksPath;
Expand All @@ -25653,7 +25673,7 @@ <h2>Settings</h2>
metadataFieldCheckbox.addEventListener('change', function () {
if (metadataFieldCheckbox.checked) {
projectorConfigTemplateJson.embeddings[0].metadataPath =
'https://gist.github.com/.../optional.metadata.tsv';
'https://raw.githubusercontent.com/.../optional.metadata.tsv';
}
else {
delete projectorConfigTemplateJson.embeddings[0].metadataPath;
Expand Down