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

Fix the tests of tf.profile #3761

Merged
merged 4 commits into from
Aug 10, 2020
Merged
Changes from 1 commit
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
Next Next commit
fix bug
  • Loading branch information
Linchenn committed Aug 10, 2020
commit af83042a836dfe918e923be8a30a0639fb2e6c32
16 changes: 8 additions & 8 deletions tfjs-core/src/engine_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@ describeWithFlags('profile', ALL_ENVS, () => {

// Test the types for `kernelTimeMs` and `extraInfo` to confirm the promises
// are resolved.
expect(typeof profile.kernels[0].kernelTimeMs).toBe('number');
expect(typeof profile.kernels[0].extraInfo).toBe('string');
expect(typeof profile.kernels[1].kernelTimeMs).toBe('number');
expect(typeof profile.kernels[1].extraInfo).toBe('string');
expect(profile.kernels[0].kernelTimeMs instanceof Promise).toBe(false);
expect(profile.kernels[0].extraInfo instanceof Promise).toBe(false);
expect(profile.kernels[1].kernelTimeMs instanceof Promise).toBe(false);
expect(profile.kernels[1].extraInfo instanceof Promise).toBe(false);

// The specific values of `kernelTimeMs` and `extraInfo` are tested in the
// tests of Profiler.profileKernel, so their values are not tested here.
Expand Down Expand Up @@ -437,8 +437,8 @@ describeWithFlags('profile', ALL_ENVS, () => {
expect(profile.newTensors).toBe(2);
expectArraysClose(await result.data(), [1, 4, 9]);
expect(profile.kernels.length).toBe(1);
expect(typeof profile.kernels[0].kernelTimeMs).toBe('number');
expect(typeof profile.kernels[0].extraInfo).toBe('string');
expect(profile.kernels[0].kernelTimeMs instanceof Promise).toBe(false);
expect(profile.kernels[0].extraInfo instanceof Promise).toBe(false);
expect(profile.kernels[0]).toEqual({
'name': 'Square',
'bytesAdded': 12,
Expand Down Expand Up @@ -468,8 +468,8 @@ describeWithFlags('profile', ALL_ENVS, () => {
expect(profile.newTensors).toBe(1);
expectArraysClose(await result.data(), [1, 2, 3]);
expect(profile.kernels.length).toBe(1);
expect(typeof profile.kernels[0].kernelTimeMs).toBe('number');
expect(typeof profile.kernels[0].extraInfo).toBe('string');
expect(profile.kernels[0].kernelTimeMs instanceof Promise).toBe(false);
expect(profile.kernels[0].extraInfo instanceof Promise).toBe(false);
expect(profile.kernels[0]).toEqual({
'name': 'Square',
'bytesAdded': 12,
Expand Down