Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
Wrap cropAndResize with an op decorator (#1506)
Browse files Browse the repository at this point in the history
BUG

Because we weren't wrapping cropAndResize using the op decorator, a user was seeing this stack trace when executing a model that had cropAndResize as an op:

```
engine.ts:197 Uncaught (in promise) TypeError: Cannot read property 'name' of null
    at e.runKernel (engine.ts:197)
    at Object.cropAndResize_ [as cropAndResize] (image_ops.ts:296)
    at executeOp$8 (image_executor.ts:65)
    at executeOp$16 (operation_executor.ts:65)
    at p (graph_executor.ts:323)
    at e.processStack (graph_executor.ts:309)
    at e.<anonymous> (graph_executor.ts:294)
    at callbacks.ts:17
    at Object.next (callbacks.ts:17)
    at i (callbacks.ts:17)
```
  • Loading branch information
dsmilkov authored Jan 24, 2019
1 parent c3419e1 commit 675e95d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class Engine implements TensorManager, TensorTracker, DataMover {
saved.push(x);
return x;
};
const scopeName = this.activeScope.name;
const scopeName = this.activeScope != null ? this.activeScope.name : '';
const startingBytecount = this.numBytes;
const startingNumTensors = this.numTensors;

Expand Down
2 changes: 1 addition & 1 deletion src/ops/image_ops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,4 @@ export const resizeBilinear = op({resizeBilinear_});
export const resizeNearestNeighbor = op({resizeNearestNeighbor_});
export const nonMaxSuppression = op({nonMaxSuppression_});
export const nonMaxSuppressionAsync = nonMaxSuppressionAsync_;
export const cropAndResize = cropAndResize_;
export const cropAndResize = op({cropAndResize_});

0 comments on commit 675e95d

Please sign in to comment.