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
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ declare module '../../tensor' {
}

Tensor.prototype.add = function<T extends Tensor>(b: Tensor|TensorLike): T {
this.throwIfDisposed();
return add(this, b);
};
24 changes: 12 additions & 12 deletions tfjs-core/src/public/chained_ops/batchnorm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ import {Rank, TensorLike} from '../../types';
declare module '../../tensor' {
interface Tensor<R extends Rank = Rank> {
batchNorm<T extends Tensor>(
mean: Tensor<R> | Tensor1D | TensorLike,
variance: Tensor<R> | Tensor1D | TensorLike,
offset?: Tensor<R> | Tensor1D | TensorLike,
scale?: Tensor<R> | Tensor1D | TensorLike,
varianceEpsilon?: number
): Tensor<R>;
mean: Tensor<R>|Tensor1D|TensorLike,
variance: Tensor<R>|Tensor1D|TensorLike,
offset?: Tensor<R>|Tensor1D|TensorLike,
scale?: Tensor<R>|Tensor1D|TensorLike,
varianceEpsilon?: number): Tensor<R>;
}
}

Tensor.prototype.batchNorm = function <R extends Rank>(
this: Tensor<R> | TensorLike, mean: Tensor<R> | Tensor1D | TensorLike,
variance: Tensor<R> | Tensor1D | TensorLike,
offset?: Tensor<R> | Tensor1D | TensorLike,
scale?: Tensor<R> | Tensor1D | TensorLike,
varianceEpsilon?: number): Tensor<R> {
Tensor.prototype.batchNorm = function<R extends Rank>(
mean: Tensor<R>|Tensor1D|TensorLike,
variance: Tensor<R>|Tensor1D|TensorLike,
offset?: Tensor<R>|Tensor1D|TensorLike,
scale?: Tensor<R>|Tensor1D|TensorLike,
varianceEpsilon?: number): Tensor<R> {
this.throwIfDisposed();
return batchNorm(this, mean, variance, offset, scale, varianceEpsilon);
};
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/broadcast_to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ declare module '../../tensor' {

Tensor.prototype.broadcastTo = function<R extends Rank>(shape: ShapeMap[R]):
Tensor<R> {
this.throwIfDisposed();
return broadcastTo(this, shape);
};
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/div.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ declare module '../../tensor' {
}

Tensor.prototype.div = function<T extends Tensor>(b: Tensor|TensorLike): T {
this.throwIfDisposed();
return div(this, b);
};
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/div_no_nan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ declare module '../../tensor' {

Tensor.prototype.divNoNan = function<T extends Tensor>(b: Tensor|
TensorLike): T {
this.throwIfDisposed();
return divNoNan(this, b);
};
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/one_hot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ declare module '../../tensor' {

Tensor.prototype.oneHot = function(
depth: number, onValue = 1, offValue = 0): Tensor {
this.throwIfDisposed();
return oneHot(this, depth, onValue, offValue);
};
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/pad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ declare module '../../tensor' {

Tensor.prototype.pad = function<T extends Tensor>(
this: T, paddings: Array<[number, number]>, constantValue: number): T {
this.throwIfDisposed();
return pad(this, paddings, constantValue);
};
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/squared_difference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ declare module '../../tensor' {

Tensor.prototype.squaredDifference = function<T extends Tensor>(b: Tensor|
TensorLike): T {
this.throwIfDisposed();
return squaredDifference(this, b);
};
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ declare module '../../tensor' {
}

Tensor.prototype.tile = function<T extends Tensor>(reps: number[]): T {
this.throwIfDisposed();
return tile(this, reps) as T;
};
1 change: 1 addition & 0 deletions tfjs-core/src/public/chained_ops/transpose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ declare module '../../tensor' {

Tensor.prototype.transpose = function<T extends Tensor>(
this: T, perm?: number[]): T {
this.throwIfDisposed();
return transpose(this, perm);
};