function oneHot_(indices, depth, onValue = 1, offValue = 0, dtype = "int32") {
    if (depth < 2) throw new Error(`Error in oneHot: depth must be >=2, but it is ${depth}`);
    const $indices = (0, _tensorUtilEnv.convertToTensor)(indices, "indices", "oneHot", "int32");
    const inputs = {
        indices: $indices
    };
    const attrs = {
        dtype,
        depth,
        onValue,
        offValue
    };
    return (0, _engine.ENGINE).runKernel((0, _kernelNames.OneHot), inputs, attrs);
}
Creates a one-hot `tf.Tensor`. The locations represented by `indices` take
value `onValue` (defaults to 1), while all other locations take value
`offValue` (defaults to 0). If `indices` is rank `R`, the output has rank
`R+1` with the last axis of size `depth`.
`indices` used to encode prediction class must start from 0. For example,
 if you have 3 classes of data, class 1 should be encoded as 0, class 2
 should be 1, and class 3 should be 2.

```js
tf.oneHot(tf.tensor1d([0, 1], 'int32'), 3).print();
```

@param indices `tf.Tensor` of indices with dtype `int32`. Indices must
start from 0.
@param depth The depth of the one hot dimension.
@param onValue A number used to fill in the output when the index matches
the location.
@param offValue A number used to fill in the output when the index does
    not match the location.
@param dtype The dtype of the output tensor, default to 'int32'.

@doc {heading: 'Tensors', subheading: 'Creation'}