1 | /**
|
2 | * @license
|
3 | * Copyright 2020 Google LLC. All Rights Reserved.
|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | * you may not use this file except in compliance with the License.
|
6 | * You may obtain a copy of the License at
|
7 | *
|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
9 | *
|
10 | * Unless required by applicable law or agreed to in writing, software
|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 | * See the License for the specific language governing permissions and
|
14 | * limitations under the License.
|
15 | * =============================================================================
|
16 | */
|
17 | import { Tensor1D, Tensor2D } from '../tensor';
|
18 | import { TensorLike } from '../types';
|
19 | /**
|
20 | * Outputs a vector with length `size` and the same dtype as `weights`.
|
21 | *
|
22 | * If `weights` are empty, then index `i` stores the number of times the value
|
23 | * `i` is counted in `x`. If `weights` are non-empty, then index `i` stores the
|
24 | * sum of the value in `weights` at each index where the corresponding value in
|
25 | * `x` is `i`.
|
26 | *
|
27 | * Values in `x` outside of the range [0, size) are ignored.
|
28 | *
|
29 | * @param x The input int tensor, rank 1 or rank 2.
|
30 | * @param weights The weights tensor, must have the same shape as x, or a
|
31 | * length-0 Tensor, in which case it acts as all weights equal to 1.
|
32 | * @param size Non-negative integer.
|
33 | * @param binaryOutput Optional. Whether the kernel should count the appearance
|
34 | * or number of occurrences. Defaults to False.
|
35 | *
|
36 | * @doc {heading: 'Operations', subheading: 'Reduction'}
|
37 | */
|
38 | declare function denseBincount_<T extends Tensor1D | Tensor2D>(x: T | TensorLike, weights: T | TensorLike, size: number, binaryOutput?: boolean): T;
|
39 | export declare const denseBincount: typeof denseBincount_;
|
40 | export {};
|