Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,11 @@ export class Minimap {
downloadContext.drawImage(image, 0, 0,
this.downloadCanvas.width, this.downloadCanvas.height);
};
let blob = new Blob([svgXml], {type: 'image/svg+xml;charset=utf-8'});
image.src = URL.createObjectURL(blob);
image.onerror = () => {
let blob = new Blob([svgXml], {type: 'image/svg+xml;charset=utf-8'});
image.src = URL.createObjectURL(blob);
}
image.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svgXml);
}

/**
Expand Down
146 changes: 107 additions & 39 deletions tensorflow/tensorboard/dist/tf-tensorboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@
// e.g. if TensorBoard was opened into a new tab that isn't visible.
// As a workaround... we know requestAnimationFrame won't fire until the
// page has focus, so updateStyles again on requestAnimationFrame.
window.requestAnimationFrame(() => this.updateStyles());
var _this = this;
window.requestAnimationFrame(function() {_this.updateStyles();});
},
_checkboxChange: function(e) {
var name = e.srcElement.name;
Expand All @@ -368,16 +369,15 @@
this.outSelected = change.base.slice();
},
toggleAll: function() {
var _this = this;
var allOn = this.namesMatchingRegex
.filter((n) => !this.runToIsCheckedMapping[n])
.filter(function(n) {return !_this.runToIsCheckedMapping[n]})
.length === 0;

this.namesMatchingRegex.forEach((n) => this.runToIsCheckedMapping[n] = !allOn);
this.namesMatchingRegex.forEach(function(n) {_this.runToIsCheckedMapping[n] = !allOn});
this.runToIsCheckedMapping = _.clone(this.runToIsCheckedMapping);
},
});
</script>

</dom-module>

<dom-module id="tf-run-selector" assetpath="../tf-event-dashboard/">
Expand Down Expand Up @@ -4144,24 +4144,26 @@ <h3>
}
});
}
var totalMicroSeconds = 0;
var outputSize = null;
if (nodeStats.output) {
outputSize = _.map(nodeStats.output, function (output) {
return _.map(output.tensor_description.shape.dim, function (dim) { return Number(dim.size); });
});
}
graph.nodes[nodeName].device = devStats.device;
if (graph.nodes[nodeName].stats == null) {
graph.nodes[nodeName].stats = new NodeStats(outputSize);
}
graph.nodes[nodeName].stats.addBytesAllocation(totalBytes);
if (nodeStats.all_end_rel_micros) {
if (nodeStats.all_end_rel_micros > 0) {
totalMicroSeconds = Number(nodeStats.all_end_rel_micros);
graph.nodes[nodeName].stats.addExecutionTime(nodeStats.all_start_micros, nodeStats.all_start_micros + nodeStats.all_end_rel_micros);
}
else {
/* tslint:disable */
console.log('ignoring negative runtime for ' + nodeName);
}
}
var outputSize = null;
if (nodeStats.output) {
outputSize = _.map(nodeStats.output, function (output) {
return _.map(output.tensor_description.shape.dim, function (dim) { return Number(dim.size); });
});
}
graph.nodes[nodeName].device = devStats.device;
graph.nodes[nodeName].stats = new NodeStats(totalBytes, totalMicroSeconds, outputSize);
});
});
}
Expand All @@ -4170,11 +4172,53 @@ <h3>
* Execution stats for the node.
*/
var NodeStats = (function () {
function NodeStats(totalBytes, totalMicros, outputSize) {
this.totalBytes = totalBytes;
this.totalMicros = totalMicros;
function NodeStats(outputSize) {
this.outputSize = outputSize;
}
/**
* Add the start and end time for a particular kernel execution of this op.
* Ops can have multiple kernel executions within the same session run.
*/
NodeStats.prototype.addExecutionTime = function (startTime, endTime) {
if (this.startTime != null) {
this.startTime = Math.min(this.startTime, startTime);
}
else {
this.startTime = startTime;
}
if (this.endTime != null) {
this.endTime = Math.max(this.endTime, endTime);
}
else {
this.endTime = endTime;
}
};
/**
* Add the bytes allocated for a particular kernel execution of this op.
* Ops can have multiple kernel executions within the same session run.
*/
NodeStats.prototype.addBytesAllocation = function (totalBytes) {
if (this.totalBytes != null) {
this.totalBytes = Math.max(this.totalBytes, totalBytes);
}
else {
this.totalBytes = totalBytes;
}
};
Object.defineProperty(NodeStats.prototype, "totalMicros", {
/**
* Total number of compute time in microseconds used for the node.
* Sum of all children if it is a Group node. Null if it is unknown.
*/
get: function () {
if (this.startTime == null || this.endTime == null) {
return null;
}
return this.endTime - this.startTime;
},
enumerable: true,
configurable: true
});
/**
* Combines the specified stats with the current stats.
* Modifies the current object. This method is used to
Expand All @@ -4185,7 +4229,7 @@ <h3>
this.totalBytes += stats.totalBytes;
}
if (stats.totalMicros != null) {
this.totalMicros += stats.totalMicros;
this.addExecutionTime(stats.startTime, stats.endTime);
}
};
return NodeStats;
Expand Down Expand Up @@ -5131,7 +5175,7 @@ <h3>
// Reset stats for each group node.
_.each(h.getNodeMap(), function (node, nodeName) {
if (node.isGroupNode) {
node.stats = new graph_1.NodeStats(0, 0, null);
node.stats = new graph_1.NodeStats(null);
node.deviceHistogram = {};
}
});
Expand Down Expand Up @@ -6345,6 +6389,7 @@ <h3>
return parsePbtxtFile(input, METADATA_REPEATED_FIELDS)
.then(function (obj) { return obj['step_stats']; });
}
parser.parseStatsPbTxt = parseStatsPbTxt;
/**
* Parses a blob of proto txt file into javascript object.
*
Expand Down Expand Up @@ -8615,10 +8660,11 @@ <h3>
stampType =
groupNodeInfo.node.hasNonControlEdges ? 'vertical' : 'horizontal';
}
scene
.selectOrCreateChild(shapeGroup, 'use', scene.Class.Node.COLOR_TARGET + ' ' + groupNodeInfo.isFadedOut ?
'faded-ellipse' :
'')
var classList = [scene.Class.Node.COLOR_TARGET];
if (groupNodeInfo.isFadedOut) {
classList.push('faded-ellipse');
}
scene.selectOrCreateChild(shapeGroup, 'use', classList)
.attr('xlink:href', '#op-series-' + stampType + '-stamp');
scene.selectOrCreateChild(shapeGroup, 'rect', scene.Class.Node.COLOR_TARGET)
.attr({ rx: d.radius, ry: d.radius });
Expand Down Expand Up @@ -9006,7 +9052,7 @@ <h3>
*
* @param container
* @param tagName tag name.
* @param className (optional) Class name.
* @param className (optional) Class name or a list of class names.
* @param before (optional) reference DOM node for insertion.
* @return selection of the element
*/
Expand All @@ -9016,7 +9062,12 @@ <h3>
return child;
}
var newElement = document.createElementNS('http://www.w3.org/2000/svg', tagName);
if (className) {
if (className instanceof Array) {
for (var i = 0; i < className.length; i++) {
newElement.classList.add(className[i]);
}
}
else {
newElement.classList.add(className);
}
if (before) {
Expand All @@ -9037,16 +9088,27 @@ <h3>
*
* @param container
* @param tagName tag name.
* @param className (optional) Class name.
* @param className (optional) Class name or list of class names.
* @return selection of the element, or an empty selection
*/
function selectChild(container, tagName, className) {
var children = container.node().childNodes;
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.tagName === tagName &&
(!className || child.classList.contains(className))) {
return d3.select(child);
if (child.tagName === tagName) {
if (className instanceof Array) {
var hasAllClasses = true;
for (var j = 0; j < className.length; j++) {
hasAllClasses =
hasAllClasses && child.classList.contains(className[j]);
}
if (hasAllClasses) {
return d3.select(child);
}
}
else if ((!className || child.classList.contains(className))) {
return d3.select(child);
}
}
}
return d3.select(null);
Expand Down Expand Up @@ -9294,14 +9356,16 @@ <h3>
// Sort the templates by minimum level in the graph at which they appear,
// as this leads to optimal setting of the colors of each template for
// maximum differentiation.
return _(templates).pairs()
return _(templates)
.pairs()
.sortBy(function (pair) {
return pair[1].level;
})
.map(function (pair) {
return [pair[0], pair[1].nodes];
})
.object().value();
.object()
.value();
}
template.detect = detect;
;
Expand Down Expand Up @@ -9349,7 +9413,8 @@ <h3>
}
return hash;
}, {});
return _(hashDict).pairs()
return _(hashDict)
.pairs()
.filter(function (pair) {
return pair[1].nodes.length > 1;
})
Expand Down Expand Up @@ -9922,8 +9987,11 @@ <h3>
downloadContext.clearRect(0, 0, _this.downloadCanvas.width, _this.downloadCanvas.height);
downloadContext.drawImage(image, 0, 0, _this.downloadCanvas.width, _this.downloadCanvas.height);
};
var blob = new Blob([svgXml], { type: 'image/svg+xml;charset=utf-8' });
image.src = URL.createObjectURL(blob);
image.onerror = function() {
var blob = new Blob([svgXml], {type: "image/svg+xml;charset=utf-8"});
image.src = URL.createObjectURL(blob);
};
image.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(svgXml);
};
/**
* Handles changes in zooming/panning. Should be called from the main svg
Expand Down Expand Up @@ -12394,7 +12462,7 @@ <h2>[[title]]</h2>

.allcontrols {
width: 188px;
padding: 30px;
padding: 0 30px;
}

.legend-holder {
Expand Down Expand Up @@ -12941,12 +13009,12 @@ <h2>[[title]]</h2>
name: runName,
path: this.router.graph(runName, tf.graph.LIMIT_ATTR_SIZE,
tf.graph.LARGE_ATTRS_KEY),
runMetadata: _.map(runToMetadata[runName], function(tag) {
runMetadata: runToMetadata[runName] ? _.map(runToMetadata[runName].sort(), function(tag) {
return {
tag: tag,
path: this.router.runMetadata(tag, runName)
};
}, this)
}, this) : []
};
}, this);
this.set('_datasets', datasets);
Expand Down Expand Up @@ -13167,4 +13235,4 @@ <h2>Settings</h2>
});
</script>
</dom-module>
</body></html>
</body></html>