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
17 changes: 14 additions & 3 deletions tfjs-layers/src/layers/convolutional_recurrent.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/**
* @license
* Copyright 2020 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/

import * as tfc from '@tensorflow/tfjs-core';
import {Tensor, util} from '@tensorflow/tfjs-core';

Expand Down Expand Up @@ -339,10 +349,10 @@ export class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {
assertPositiveInteger(this.filters, 'filters');

this.kernelSize = normalizeArray(kernelSize, 2, 'kernelSize');
this.kernelSize.map(size => assertPositiveInteger(size, 'kernelSize'));
this.kernelSize.forEach(size => assertPositiveInteger(size, 'kernelSize'));

this.strides = normalizeArray(strides || 1, 2, 'strides');
this.strides.map(stride => assertPositiveInteger(stride, 'strides'));
this.strides.forEach(stride => assertPositiveInteger(stride, 'strides'));

this.padding = padding || 'valid';
checkPaddingMode(this.padding);
Expand All @@ -351,7 +361,8 @@ export class ConvLSTM2DCell extends LSTMCell implements ConvRNN2DCell {
checkDataFormat(this.dataFormat);

this.dilationRate = normalizeArray(dilationRate || 1, 2, 'dilationRate');
this.dilationRate.map(rate => assertPositiveInteger(rate, 'dilationRate'));
this.dilationRate.forEach(
rate => assertPositiveInteger(rate, 'dilationRate'));
}

public build(inputShape: Shape|Shape[]): void {
Expand Down
10 changes: 10 additions & 0 deletions tfjs-layers/src/layers/convolutional_recurrent_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

/**
* @license
* Copyright 2020 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/

import * as tfc from '@tensorflow/tfjs-core';

import {sequential} from '../exports';
Expand Down