- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 112 for set_shape (0.36 sec)
-
tensorflow/c/tf_tensor.cc
} void* TensorInterface::Data() const { return tensorflow::TensorCApi::Buffer(tensor_)->data(); } void TensorInterface::SetShape(const int64_t* dims, int num_dims) { tensorflow::TensorShape s; for (int i = 0; i < num_dims; ++i) { s.AddDim(dims[i]); } tensor_.set_shape(s); } Status TensorInterface::BitcastFrom(const TensorInterface& from, DataType type,
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Sun Apr 14 21:57:32 UTC 2024 - 11.5K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/utils/utils.h
} int rank = shaped_type.getRank(); if (rank < 2) { return nullptr; } SmallVector<int64_t> new_shape(shaped_type.getShape().begin(), shaped_type.getShape().end()); std::swap(new_shape[rank - 1], new_shape[rank - 2]); return shaped_type.clone(new_shape); } // Returns a ShapedType for a permutation and the shape of input after
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Tue Apr 30 00:40:15 UTC 2024 - 11.6K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/ir/tf_ops_a_m.cc
if (s0_shape == s1_shape) return; for (int i = bcasted_shape.size(); i > 0; --i) { int idx = bcasted_shape.size() - i; int s0_idx = i > s0_shape.size() ? -1 : s0_shape.size() - i; int s1_idx = i > s1_shape.size() ? -1 : s1_shape.size() - i; if (s0_idx == -1) { r0.push_back(idx); if (s1_shape[s1_idx] == 1) r1.push_back(idx); } else if (s1_idx == -1) {
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 146.7K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/transforms/einsum.cc
auto shape = value_type.getShape(); llvm::SmallVector<int64_t> sum_shape; for (int i = 0; i < shape.size(); ++i) { if (std::find(redux_axes.begin(), redux_axes.end(), i) == redux_axes.end()) { sum_shape.push_back(shape[i]); } } return rewriter->create<TF::SumOp>( loc, RankedTensorType::get(sum_shape, value_type.getElementType()), value, redux_op); }
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 33.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/optimize.cc
// only when height = width. if (params_type.getShape().size() != 4 || indices_type.getShape().size() != 2) return failure(); if (params_type.getShape()[1] != 1) return failure(); if (params_type.getShape()[0] != params_type.getShape()[2]) return failure(); if (result_type.getShape()[0] != params_type.getShape()[0] * 2) return failure();
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Tue Apr 30 00:40:15 UTC 2024 - 102.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/tensorflow/passes/convert_tf_xla_op_to_tf_op.cc
mlir::cast<ShapedType>(slice_sizes.getType()).getShape(), builder.getI64Type()), slice_sizes)); // Collapses dimensions by reshaping. SmallVector<int64_t> new_shape(operand_rank - collapsed_dims.size()); for (int64_t i = 0, j = 0; i < operand_rank; i++) { if (!collapsed_dims.contains(i)) { new_shape[j++] = operand_shape[i]; } }
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 13.2K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/experimental/tac/transforms/device_transform_patterns.cc
// Get the new shape. SmallVector<int64_t, 4> new_shape; for (int i = 0; i < 4 - rank; ++i) { new_shape.push_back(1); } for (auto size : input_type.getShape()) { new_shape.push_back(size); } auto reshape_op = InsertReshapeOp(concat_op.getLoc(), input, input_type.getElementType(), new_shape, &rewriter); reshape_ops.push_back(reshape_op.getResult());
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 25.4K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/legalize_tf.cc
op->getLoc(), permute_attr.getType(), permute_attr); llvm::SmallVector<int64_t, 2> new_shape{type.getShape()[1], type.getShape()[0]}; auto output = rewriter.create<TFL::TransposeOp>( op->getLoc(), RankedTensorType::get(new_shape, type.getElementType()), input, permute); return {success(), output}; };
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Mon May 20 20:06:54 UTC 2024 - 45.2K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/transforms/tpu_space_to_depth_pass.cc
TF::ReshapeOp GetReshapeOpForConv2DFilter(ArrayRef<int64_t> new_shape, Value input, OpBuilder* builder) { auto reshape_result_type = RankedTensorType::get(new_shape, getElementTypeOrSelf(input)); auto reshape_type = RankedTensorType::get( {static_cast<int64_t>(new_shape.size())}, builder->getIntegerType(64));
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 29.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/ir/tf_ops_tensor_helper.cc
} } ArrayRef<int64_t> shape = ranked_ty.getShape(); SmallVector<int64_t, 4> out_shape; out_shape.reserve(rank - (keep_dims.getValue() ? 0 : num_reduce_dim)); for (int64_t i = 0; i < rank; ++i) { if (!is_reduce_dim[i]) out_shape.push_back(shape[i]); else if (keep_dims.getValue()) out_shape.push_back(1); } return RankedTensorType::get(out_shape, element_ty); }
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 6.7K bytes - Viewed (0)