- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 29 for getShape (0.34 sec)
-
tensorflow/compiler/mlir/tensorflow/ir/tf_ops_tensor_helper.cc
} } auto ranked_type = mlir::dyn_cast<RankedTensorType>(result_type); if (!ranked_type) return UnrankedTensorType::get(builder->getI1Type()); return RankedTensorType::get(ranked_type.getShape(), builder->getI1Type()); } Type InferReductionOpType(Value input, Value reduction_indices, BoolAttr keep_dims) { Type input_ty = input.getType();
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 6.7K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_utils.cc
} return std::nullopt; } ShapedType GetNhwcReturnTypeFromNchw(Operation* old_op) { auto composite_result_shape = mlir::cast<ShapedType>(old_op->getResults().front().getType()).getShape(); std::array<int64_t, 4> output_shape; // NHWC <- NCHW output_shape[0] = composite_result_shape[0]; output_shape[1] = composite_result_shape[2]; output_shape[2] = composite_result_shape[3];
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed May 29 18:33:05 UTC 2024 - 3.4K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/ir/tf_ops_layout_helper.cc
Type ShuffleRankedTensorType(Type type, ArrayRef<int64_t> permutation) { if (auto ranked_type = mlir::dyn_cast<RankedTensorType>(type)) { ArrayRef<int64_t> shape = ranked_type.getShape(); assert(permutation.size() == shape.size()); SmallVector<int64_t, 4> new_shape(permutation.size()); for (size_t i = 0; i < permutation.size(); ++i) new_shape[i] = shape[permutation[i]];
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 3.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/unfold_large_splat_constant.cc
tensorflow::GetTypeFromTFTensorShape( {splat_elements_attr.getType().getRank()}, op_builder->getI64Type()), splat_elements_attr.getType().getShape())); mlir::arith::ConstantOp fill_value = op_builder->create<mlir::arith::ConstantOp>( const_op->getLoc(), DenseElementsAttr::get( tensorflow::GetTypeFromTFTensorShape(
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 4.5K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/reduce_type_precision.cc
if (v_int > 7 || v_int < -8) { return failure(); } } Builder builder(op.getContext()); auto shaped_type = mlir::RankedTensorType::get(const_type.getShape(), builder.getI4Type()); auto newAttr = DenseElementsAttr::getFromRawBuffer( shaped_type, mlir::cast<DenseElementsAttr>(op.getValue()).getRawData()); rewriter.replaceOpWithNewOp<arith::ConstantOp>(op, newAttr);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 5.4K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/common/ir/QuantOps.cc
} } // Verify axisStats (optional) attribute. if (getAxisStats()) { if (!getAxis()) return emitOpError("axis must be specified for axisStats"); auto shape = tensorArg.getShape(); auto argSliceSize = std::accumulate(std::next(shape.begin(), *getAxis()), shape.end(), 1, std::multiplies<int64_t>()); auto axisStatsType = getAxisStats()->getShapedType();
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 5.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/tensorflow/transforms/tpu_annotate_dynamic_shape_inputs.cc
auto inputType = mlir::dyn_cast<RankedTensorType>(arg.getType()); // Only rank 1 tensor is supported for now. if (!inputType || inputType.getRank() != 1) continue; auto shape = llvm::to_vector<4>(inputType.getShape()); llvm::SmallVector<int64_t, 4> bounds(shape.begin(), shape.end()); // Mark the dim as dynamic dim. shape[0] = ShapedType::kDynamic; auto extensions =
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 6.2K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/quantization/ir/QuantOps.cc
} } // Verify axisStats (optional) attribute. if (getAxisStats()) { if (!getAxis()) return emitOpError("axis must be specified for axisStats"); auto shape = tensorArg.getShape(); auto argSliceSize = std::accumulate(std::next(shape.begin(), *getAxis()), shape.end(), 1, std::multiplies<int64_t>()); auto axisStatsType = getAxisStats()->getShapedType();
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 5.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/legalize_jax_random.cc
func.eraseBody(); func.addEntryBlock(); ImplicitLocOpBuilder builder(func.getLoc(), func.getBody()); llvm::SmallVector<int32_t> result_shape_i32; auto result_shape = result_ty.getShape(); for (auto element : result_shape) { result_shape_i32.push_back(static_cast<int32_t>(element)); } auto result_shape_attr = builder.getI32TensorAttr(result_shape_i32); Value result_shape_tensor =
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 5.1K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/utils/constant_utils.cc
absl::StatusOr<arith::ConstantOp> CreateConstOpWithVectorValue( PatternRewriter* rewriter, Location loc, ShapedType shaped_type, int value) { ShapedType dense_type = RankedTensorType::get(shaped_type.getShape(), shaped_type.getElementType()); auto attr = CreateTypedAttr(dense_type, value); return rewriter->create<arith::ConstantOp>(loc, dense_type,
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 6.5K bytes - Viewed (0)