-
Notifications
You must be signed in to change notification settings - Fork 943
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @Lewuathe)
src/ops/signal_ops.ts, line 72 at r1 (raw file):
* @doc {heading: 'Operations', subheading: 'Signal', namespace: 'signal'} */ function frame_(input: Tensor1D, frameLength: number,
s/input/signal
src/ops/signal_ops.ts, line 73 at r1 (raw file):
*/ function frame_(input: Tensor1D, frameLength: number, frameStep: number): Tensor {
checking that you're using vscode and our autoformatter :)
src/ops/signal_ops.ts, line 73 at r1 (raw file):
*/ function frame_(input: Tensor1D, frameLength: number, frameStep: number): Tensor {
can you add padEnd, padValue, and axis?
src/ops/signal_ops.ts, line 85 at r1 (raw file):
} return concat(output).as2D(output.length, frameLength);
output.concat
src/ops/signal_ops_test.ts, line 89 at r1 (raw file):
it('3 length frames with step 5', () => { const input = tf.tensor1d([1, 2, 3, 4, 5]); const output = tf.frame(input, 3, 5);
this should be tf.signal.frame
the export here needs to be changed to export * as signal:
https://github.com/tensorflow/tfjs-core/blob/master/src/ops/ops.ts#L47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @Lewuathe and @nsthorat)
src/ops/signal_ops.ts, line 73 at r1 (raw file):
Previously, nsthorat (Nikhil Thorat) wrote…
can you add padEnd, padValue, and axis?
Okay, I'll try.
src/ops/signal_ops.ts, line 85 at r1 (raw file):
Previously, nsthorat (Nikhil Thorat) wrote…
output.concat
Actually, the output is not tensor. As it's just an array of tensor, we can not call ops directly.
src/ops/signal_ops_test.ts, line 89 at r1 (raw file):
Previously, nsthorat (Nikhil Thorat) wrote…
this should be tf.signal.frame
the export here needs to be changed to export * as signal:
https://github.com/tensorflow/tfjs-core/blob/master/src/ops/ops.ts#L47
Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r2.
Reviewable status:complete! 1 of 1 approvals obtained (waiting on @Lewuathe)
src/ops/signal_ops.ts, line 64 at r2 (raw file):
* * ```js * tf.frame([1, 2, 3], 2, 1).print();
we just added a new CI that runs the snippets and checks for errors, this is failing now because you need to do tf.signal
src/ops/signal_ops.ts, line 66 at r2 (raw file):
* tf.frame([1, 2, 3], 2, 1).print(); * ``` * @param input The input tensor to be expanded
s/input/signal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 1 of 1 approvals obtained (waiting on @Lewuathe)
src/ops/signal_ops_test.ts, line 105 at r2 (raw file):
const output = tf.signal.frame(input, 6, 0); expect(output.shape).toEqual([0, 6]); expectArraysClose(output, []);
FYI Apologies for this but once this PR is in you will have to do .data(): #1716
Thanks but unfortunately I do not have permission to look into that. But anyway, I guess the problem is fixed. |
Ah looks like we may have a bug, I think this will fix it: #1737 |
Thanks for the awesome PR as always @Lewuathe :) |
Add frame op as provided in TensorFlow core. It's also needed to implement stft, istft ops to make slices of the sample.
See: tensorflow/tfjs#1362
This change is