/aosp_15_r20/external/tensorflow/tensorflow/core/api_def/base_api/ |
H A D | api_def_OneHot.pbtxt | 80 [5.0 0.0 0.0] // one_hot(0) 81 [0.0 0.0 5.0] // one_hot(2) 82 [0.0 0.0 0.0] // one_hot(-1) 83 [0.0 5.0 0.0] // one_hot(1) 102 // ^ one_hot(0) 103 // ^ one_hot(2) 104 // ^ one_hot(-1) 105 // ^ one_hot(1) 121 [1.0, 0.0, 0.0] // one_hot(0) 122 [0.0, 0.0, 1.0] // one_hot(2) [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/python/ops/ragged/ |
H A D | ragged_one_hot_op_test.py | 110 # array_ops.one_hot is -1. 129 array_ops.one_hot( 157 """Tests that tf.one_hot gives the same result for ragged & uniform tensors. 159 Runs tf.one_hot with a uniform tensor, and compares the output with the 160 results of calling tf.one_hot with ragged version of that tensor with 164 indices_shape: Shape for `indices` arg to `tf.one_hot` 165 depth: `depth` arg to `tf.one_hot` 166 on_value: `on_value` arg to `tf.one_hot` 167 off_value: `off_value` arg to `tf.one_hot` 168 axis: `axis` arg to `tf.one_hot` [all …]
|
H A D | ragged_array_ops.py | 542 # ragged.one_hot 544 @dispatch.dispatch_for_api(array_ops.one_hot) 552 """Applies tf.one_hot along the values of a RaggedTensor.""" 553 # Get the adjusted axis value for the call to array_ops.one_hot. 554 # Note: the only negative `axis` value supported by array_ops.one_hot is -1. 566 array_ops.one_hot(indices.flat_values, depth, on_value, off_value, axis,
|
/aosp_15_r20/external/tensorflow/tensorflow/lite/testing/op_tests/ |
H A D | one_hot.py | 15 """Test configs for one_hot.""" 24 """Make a set of tests to do one_hot.""" 35 """Build the one_hot op testing graph.""" 43 out = tf.one_hot(indices=indices, depth=depth) 50 out = tf.one_hot( 60 """Build the input for one_hot op."""
|
/aosp_15_r20/external/tensorflow/tensorflow/python/ops/ |
H A D | ctc_ops.py | 577 initial_state_log_probs = array_ops.one_hot( 584 label_final_state_mask = array_ops.one_hot( 602 one_hot = array_ops.one_hot(labels, depth=num_labels) 603 one_hot = array_ops.expand_dims(one_hot, axis=0) 605 state_log_probs = math_ops.reduce_sum(ilabel_log_probs * one_hot, axis=3) 618 one_hot = array_ops.one_hot( 623 one_hot = array_ops.expand_dims(one_hot, axis=0) 625 label_olabels = math_ops.reduce_logsumexp(label_states + one_hot, axis=2) 1274 one_hot = array_ops.one_hot( 1280 return math_ops.reduce_logsumexp(states + one_hot, axis=-1)
|
H A D | bincount_ops.py | 106 a token appears (equivalent to one_hot + reduce_any instead of one_hot + 282 a token appears (equivalent to one_hot + reduce_any instead of one_hot +
|
H A D | array_ops.py | 209 See also `tf.ones`, `tf.zeros`, `tf.one_hot`, `tf.eye`. 4302 @tf_export("one_hot") 4304 def one_hot(indices, function 4350 to a non-ragged axis. The output will be equivalent to applying 'one_hot' on 4360 etc.), both `on_value` and `off_value` _must_ be provided to `one_hot`. 4367 tf.one_hot(indices, depth) # output: [3 x 3] 4374 tf.one_hot(indices, depth, 4377 # [[5.0, 0.0, 0.0], # one_hot(0) 4378 # [0.0, 0.0, 5.0], # one_hot(2) 4379 # [0.0, 0.0, 0.0], # one_hot(-1) [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/lite/kernels/ |
H A D | one_hot.cc | 26 namespace one_hot { namespace 201 } // namespace one_hot 207 one_hot::Prepare, in Register_ONE_HOT() 208 one_hot::Eval, in Register_ONE_HOT()
|
/aosp_15_r20/external/tensorflow/tensorflow/dtensor/mlir/expansions/ |
H A D | meta_spmd_expander.cc | 962 const int axis, mlir::TF::OneHotOp& one_hot) { in RelayoutOneHotInput() argument 981 EmitRelayout(one_hot.indices(), *input_layout, new_input_layout)); in RelayoutOneHotInput() 983 one_hot->setOperand(0, new_input); in RelayoutOneHotInput() 1088 auto one_hot = mlir::dyn_cast<mlir::TF::OneHotOp>(op); in ComputeLayoutForward() local 1089 int axis = one_hot.axis(); in ComputeLayoutForward() 1090 if (axis == -1) axis = ValueRank(one_hot.indices()); in ComputeLayoutForward() 1113 auto one_hot = mlir::dyn_cast<mlir::TF::OneHotOp>(op); in ComputeLayoutBackward() local 1114 int axis = one_hot.axis(); in ComputeLayoutBackward() 1115 if (axis == -1) axis = ValueRank(one_hot.indices()); in ComputeLayoutBackward() 1118 llvm::DenseMap<int, Layout> input_layouts(one_hot->getNumOperands()); in ComputeLayoutBackward()
|
/aosp_15_r20/external/tensorflow/tensorflow/python/eager/benchmarks/resnet50/ |
H A D | resnet50_test_util.py | 41 one_hot = tf.one_hot(labels, num_classes) 43 return images, one_hot
|
H A D | resnet50_graph_test.py | 40 one_hot = np.zeros((batch_size, num_classes)).astype(np.float32) 41 one_hot[np.arange(batch_size), labels] = 1. 42 return images, one_hot
|
/aosp_15_r20/external/tensorflow/tensorflow/compiler/tf2xla/kernels/ |
H A D | one_hot_op.cc | 65 xla::XlaOp one_hot; in Compile() local 69 ctx->Input(3), &one_hot)); in Compile() 70 ctx->SetOutput(0, one_hot); in Compile()
|
/aosp_15_r20/external/pytorch/torch/distributions/ |
H A D | one_hot_categorical.py | 42 support = constraints.one_hot 84 return torch.nn.functional.one_hot(mode, num_classes=probs.shape[-1]).to(probs) 99 return torch.nn.functional.one_hot(indices, num_events).to(probs)
|
H A D | constraints.py | 20 - ``constraints.one_hot`` 58 "one_hot", 657 one_hot = _OneHot() variable
|
/aosp_15_r20/external/pytorch/aten/src/ATen/functorch/ |
H A D | BatchRulesModules.cpp | 220 TORCH_CHECK(self.dtype() == kLong, "one_hot is only applicable to index tensor."); in one_hot_decomposition_hack() 234 TORCH_CHECK(num_classes > 0, "When vmap-ing torch.nn.functional.one_hot, please " in one_hot_decomposition_hack() 238 // Maybe one_hot should be a primitive wrt autograd so we don't have to deal with this. in one_hot_decomposition_hack() 404 m.impl("one_hot", one_hot_decomposition_hack); in TORCH_LIBRARY_IMPL()
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/ |
H A D | Onehot.cpp | 17 Tensor one_hot(const Tensor &self, int64_t num_classes) { in one_hot() function 18 …TORCH_CHECK(self.dtype() == kLong, "one_hot is only applicable to index tensor of type LongTensor.… in one_hot()
|
/aosp_15_r20/external/tensorflow/tensorflow/python/kernel_tests/array_ops/ |
H A D | one_hot_op_test.py | 37 array_ops.one_hot(dtype=dtype, **inputs) 39 ans = array_ops.one_hot(dtype=dtype, **inputs) 457 tensor_one_hot = array_ops.one_hot(tensor, depth=10, axis=0)
|
/aosp_15_r20/external/tensorflow/tensorflow/lite/delegates/gpu/common/ |
H A D | operations.cc | 159 case OperationType::ONE_HOT: in ToString() 160 return "one_hot"; in ToString() 268 {"one_hot", OperationType::ONE_HOT}, in OperationTypeFromString()
|
/aosp_15_r20/external/pytorch/torch/csrc/api/include/torch/nn/functional/ |
H A D | embedding.h | 9 inline Tensor one_hot(const Tensor& tensor, int64_t num_classes = -1) { 10 return torch::one_hot(tensor, num_classes);
|
/aosp_15_r20/external/pytorch/test/functorch/ |
H A D | test_vmap_registrations.py | 22 "aten::one_hot", 149 "aten::one_hot",
|
/aosp_15_r20/external/tensorflow/tensorflow/lite/delegates/gpu/common/tasks/ |
H A D | BUILD | 652 name = "one_hot", 653 srcs = ["one_hot.cc"], 654 hdrs = ["one_hot.h"], 670 ":one_hot",
|
/aosp_15_r20/external/tensorflow/tensorflow/compiler/tf2xla/ |
H A D | xla_helpers.cc | 93 const xla::XlaOp& off_value, xla::XlaOp* one_hot) { in OneHot() argument 107 *one_hot = xla::Select( in OneHot()
|
/aosp_15_r20/external/tensorflow/tensorflow/compiler/mlir/lite/tests/ |
H A D | optimize.mlir | 2368 // Good match: Replace with one_hot 2378 …// CHECK: %[[RES:.*]] = "tfl.one_hot"(%arg0, %[[CST1]], %[[CST2]], %[[CST3]]) {axis = -1 : i32} : … 2383 // Good match: Replace with one_hot 2395 …// CHECK: %[[RES:.*]] = "tfl.one_hot"(%[[TMP]], %[[CST1]], %[[CST2]], %[[CST3]]) {axis = -1 : i32}… 2451 …%tmp_bool = "tfl.one_hot"(%arg, %depth, %bool_on, %bool_off) {axis = -1 : i32} : (tensor<2xi32>, t… 2454 …%tmp_int = "tfl.one_hot"(%arg, %depth, %int_on, %int_off) {axis = -1 : i32} : (tensor<2xi32>, tens… 2464 …// CHECK: %[[RES1:.*]] = "tfl.one_hot"(%arg0, %[[CST1]], %[[CST2]], %[[CST3]]) {axis = -1 : i32} :… 2465 …// CHECK: %[[RES2:.*]] = "tfl.one_hot"(%arg0, %[[CST1]], %[[CST4]], %[[CST5]]) {axis = -1 : i32} :… 2476 …%tmp = "tfl.one_hot"(%arg, %depth, %on, %off) {axis = -1 : i32} : (tensor<2xi32>, tensor<i32>, ten… 2494 …%tmp = "tfl.one_hot"(%arg, %depth, %on, %off) {axis = -1 : i32} : (tensor<2xi64>, tensor<i32>, ten… [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/lite/testing/ |
H A D | build_def.bzl | 107 "one_hot", 239 "one_hot",
|
/aosp_15_r20/external/tensorflow/tensorflow/compiler/tests/ |
H A D | nary_ops_test.py | 128 op = array_ops.one_hot(indices, 137 op = array_ops.one_hot(indices,
|