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
3 changes: 3 additions & 0 deletions tfjs-core/src/kernel_names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export type IdentityInputs = Pick<NamedTensorInfoMap, 'x'>;
export const Less = 'Less';
export type LessInputs = BinaryInputs;

export const LessEqual = 'LessEqual';
export type LessEqualInputs = BinaryInputs;

export const MaxPoolWithArgmax = 'MaxPoolWithArgmax';
export type MaxPoolWithArgmaxInputs = Pick<NamedTensorInfoMap, 'x'>;
export interface MaxPoolWithArgmaxAttrs {
Expand Down
32 changes: 0 additions & 32 deletions tfjs-core/src/ops/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,37 +63,6 @@ function equalStrict_<T extends Tensor>(a: T|TensorLike, b: T|TensorLike): T {
return $a.equal($b);
}

/**
* Returns the truth value of (a <= b) element-wise. Supports broadcasting.
*
* We also expose `tf.lessEqualStrict` which has the same signature as this op
* and asserts that `a` and `b` are the same shape (does not broadcast).
*
* ```js
* const a = tf.tensor1d([1, 2, 3]);
* const b = tf.tensor1d([2, 2, 2]);
*
* a.lessEqual(b).print();
* ```
*
* @param a The first input tensor.
* @param b The second input tensor. Must have the same dtype as `a`.
*/
/** @doc {heading: 'Operations', subheading: 'Logical'} */
function lessEqual_<T extends Tensor>(
a: Tensor|TensorLike, b: Tensor|TensorLike): T {
let $a = convertToTensor(a, 'a', 'lessEqual');
let $b = convertToTensor(b, 'b', 'lessEqual');
[$a, $b] = makeTypesMatch($a, $b);
assertAndGetBroadcastShape($a.shape, $b.shape);

return ENGINE.runKernelFunc((backend, save) => {
const res = backend.lessEqual($a, $b);
save([$a, $b]);
return res;
}, {a: $a, b: $b}, null /* grad */, 'LessEqual') as T;
}

function lessEqualStrict_<T extends Tensor>(
a: T|TensorLike, b: T|TensorLike): T {
const $a = convertToTensor(a, 'a', 'lessEqualStrict');
Expand Down Expand Up @@ -156,7 +125,6 @@ export const equalStrict = op({equalStrict_});
export const greaterEqual = op({greaterEqual_});
export const greaterEqualStrict = op({greaterEqualStrict_});
export const greaterStrict = op({greaterStrict_});
export const lessEqual = op({lessEqual_});
export const lessEqualStrict = op({lessEqualStrict_});
export const lessStrict = op({lessStrict_});
export const notEqualStrict = op({notEqualStrict_});
Loading