OneHot - 9 vs 11¶
- OneHot9 → OneHot11 +17 -10
OneHot9 → OneHot11
RENAMED
@@ -1 +1 @@
|
|
1
1
|
Produces a one-hot tensor based on inputs.
|
2
2
|
The locations represented by the index values in the 'indices' input tensor will have 'on_value'
|
3
3
|
and the other locations will have 'off_value' in the output tensor, where 'on_value' and 'off_value'
|
4
4
|
are specified as part of required input argument 'values', which is a two-element tensor of format
|
5
5
|
[off_value, on_value]. The rank of the output tensor will be one greater than the rank of the
|
6
6
|
input tensor. The additional dimension is for one-hot representation. The additional dimension will
|
7
7
|
be inserted at the position specified by 'axis'. If 'axis' is not specified then then additional
|
8
8
|
dimension will be inserted as the innermost dimension, i.e. axis=-1. The size of the additional
|
9
9
|
dimension is specified by required scalar input 'depth'. The type of the output tensor is the same
|
10
10
|
as the type of the 'values' input. Any entries in the 'indices' input tensor with values outside
|
11
|
-
the range [
|
11
|
+
the range [-depth, depth-1] will result in one-hot representation with all 'off_value' values in the
|
12
12
|
output tensor.
|
13
|
+
|
14
|
+
when axis = 0:
|
15
|
+
output[input[i, j, k], i, j, k] = 1 for all i, j, k and 0 otherwise.
|
16
|
+
|
17
|
+
when axis = -1:
|
18
|
+
output[i, j, k, input[i, j, k]] = 1 for all i, j, k and 0 otherwise.
|
13
19
|
**Attributes**
|
14
20
|
* **axis**:
|
15
21
|
(Optional) Axis along which one-hot representation in added.
|
16
22
|
Default: axis=-1. axis=-1 means that the additional dimension will
|
17
23
|
be inserted as the innermost/last dimension in the output tensor.
|
24
|
+
Negative value means counting dimensions from the back. Accepted
|
25
|
+
range is [-r-1, r] where r = rank(indices).
|
18
26
|
**Inputs**
|
19
27
|
* **indices** (heterogeneous) - **T1**:
|
28
|
+
Input tensor containing indices. Any entries in the 'indices' input
|
29
|
+
tensor with values outside the range [-depth, depth-1] will result
|
30
|
+
in one-hot representation with all 'off_value' values in the output
|
31
|
+
tensor.In case 'indices' is of non-integer type, the values will be
|
32
|
+
casted to int64 before use.
|
20
|
-
Input tensor containing indices. The values must be non-negative
|
21
|
-
integers. Any entries in the 'indices' input tensor with values
|
22
|
-
outside the range [0, depth) will result in one-hot representation
|
23
|
-
with all 'off_value' values in the output tensor.In case 'indices'
|
24
|
-
is of non-integer type, the values will be casted to int64 before
|
25
|
-
use.
|
26
33
|
* **depth** (heterogeneous) - **T2**:
|
27
34
|
Scalar specifying the number of classes in one-hot tensor. This is
|
28
35
|
also the size of the one-hot dimension (specified by 'axis'
|
29
36
|
attribute) added on in the output tensor. The values in the
|
30
|
-
'indices' input tensor are expected to be in the range [
|
37
|
+
'indices' input tensor are expected to be in the range [-depth,
|
31
|
-
In case 'depth' is of non-integer type, it will be casted
|
38
|
+
depth-1]. In case 'depth' is of non-integer type, it will be casted
|
32
|
-
before use.
|
39
|
+
to int64 before use.
|
33
40
|
* **values** (heterogeneous) - **T3**:
|
34
41
|
Rank 1 tensor containing exactly two elements, in the format
|
35
42
|
[off_value, on_value], where 'on_value' is the value used for
|
36
43
|
filling locations specified in 'indices' input tensor, and
|
37
44
|
'off_value' is the value used for filling locations other than those
|
38
45
|
specified in 'indices' input tensor.
|
39
46
|
**Outputs**
|
40
47
|
* **output** (heterogeneous) - **T3**:
|
41
48
|
Tensor of rank one greater than input tensor 'indices', i.e.
|
42
49
|
rank(output) = rank(indices) + 1. The data type for the elements of
|
43
50
|
the output tensor is the same as the type of input 'values' is used.
|
44
51
|
**Type Constraints**
|
45
52
|
* **T1** in (
|
46
53
|
tensor(double),
|
47
54
|
tensor(float),
|
48
55
|
tensor(float16),
|
49
56
|
tensor(int16),
|
50
57
|
tensor(int32),
|
51
58
|
tensor(int64),
|
52
59
|
tensor(int8),
|
53
60
|
tensor(uint16),
|
54
61
|
tensor(uint32),
|
55
62
|
tensor(uint64),
|
56
63
|
tensor(uint8)
|
57
64
|
):
|
58
65
|
Constrain input to only numeric types.
|
59
66
|
* **T2** in (
|
60
67
|
tensor(double),
|
61
68
|
tensor(float),
|
62
69
|
tensor(float16),
|
63
70
|
tensor(int16),
|
64
71
|
tensor(int32),
|
65
72
|
tensor(int64),
|
66
73
|
tensor(int8),
|
67
74
|
tensor(uint16),
|
68
75
|
tensor(uint32),
|
69
76
|
tensor(uint64),
|
70
77
|
tensor(uint8)
|
71
78
|
):
|
72
79
|
Constrain input to only numeric types.
|
73
80
|
* **T3** in (
|
74
81
|
tensor(bool),
|
75
82
|
tensor(complex128),
|
76
83
|
tensor(complex64),
|
77
84
|
tensor(double),
|
78
85
|
tensor(float),
|
79
86
|
tensor(float16),
|
80
87
|
tensor(int16),
|
81
88
|
tensor(int32),
|
82
89
|
tensor(int64),
|
83
90
|
tensor(int8),
|
84
91
|
tensor(string),
|
85
92
|
tensor(uint16),
|
86
93
|
tensor(uint32),
|
87
94
|
tensor(uint64),
|
88
95
|
tensor(uint8)
|
89
96
|
):
|
90
97
|
Constrain to any tensor type.
|