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
3 changes: 2 additions & 1 deletion tfjs-core/src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,8 @@ export class Engine implements TensorTracker, DataMover {
totalBytesSnapshot: this.state.numBytes,
tensorsAdded: this.state.numTensors - startingNumTensors,
totalTensorsSnapshot: this.state.numTensors,
inputShapes: Object.keys(inputs).map(key => inputs[key].shape),
inputShapes: Object.keys(inputs).map(
key => inputs[key] != null ? inputs[key].shape : null),
outputShapes: outputs.map(item => item.shape)
});
}
Expand Down
5 changes: 3 additions & 2 deletions tfjs-core/src/profiler_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ describeWithFlags('profiler.Profiler', SYNC_BACKEND_ENVS, () => {
}, delayMs * 2);
});

it('profiles nested kernel', doneFn => {
it('profiles nested kernel with optional inputs', doneFn => {
const delayMs = 5;
const queryTimeMs = 10;
const inputs = {'x': tf.tensor1d([1])};
const inputs: {'x': tf.Tensor,
'bias': null} = {'x': tf.tensor1d([1]), 'bias': null};
const extraInfo = '';
const timer = new TestBackendTimer(delayMs, queryTimeMs, extraInfo);
const logger = new TestLogger();
Expand Down