Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 50 for getShape (0.17 sec)

  1. tensorflow/compiler/mlir/lite/utils/utils.h

        if (!shaped_type || !shaped_type.hasStaticShape()) {
          return false;
        }
        if (operand_num == 0) {
          shape = shaped_type.getShape();
        } else {
          if (shape != shaped_type.getShape()) {
            return false;
          }
        }
        ++operand_num;
      }
      return true;
    }
    
    // Utility function to map final permutation to initial permutation
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/passes/convert_tf_xla_op_to_tf_op.cc

      dot_dimension_numbers.ParseFromString(dot_dimension_numbers_str.str());
      SmallVector<Value> input_arguments = {lhs, rhs};
      const int lhs_rank = mlir::cast<ShapedType>(lhs.getType()).getShape().size();
      const int rhs_rank = mlir::cast<ShapedType>(rhs.getType()).getShape().size();
    
      const std::string einsum_equation =
          CreateEinsumEquation(dot_dimension_numbers, lhs_rank, rhs_rank);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/transforms/legalize_tf.cc

                mlir::cast<ShapedType>(lhs.getType()).getShape(),
                mlir::cast<ShapedType>(rhs.getType()).getShape(),
                symbolic_broadcast_shape)) {
          return failure();
        }
    
        // Calculates the broadcast shape using BroadcastArgs op.
        Value lhs_shape = GetShape(lhs, op->getLoc(), rewriter);
        Value rhs_shape = GetShape(rhs, op->getLoc(), rewriter);
        auto broadcast_shape =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon May 20 20:06:54 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/collection_ops_util.cc

                               Location loc) {
      auto buffer_type = mlir::cast<RankedTensorType>(buffer.getType());
      if (buffer_type.getShape().size() == 1) return index;
      // Create a concat of index and trailing zeros.
      llvm::SmallVector<int64_t, 8> zeros(buffer_type.getShape().size() - 1, 0);
      auto zeros_tensor = GetR1Const(zeros, builder, loc);
      return builder.create<TF::ConcatV2Op>(
          loc,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/stablehlo/transforms/optimize.cc

      // Extract Z from %dot.
      ArrayRef<int64_t> shape_z =
          dot.getType().getShape().drop_front(shape_b.size() + shape_y2.size());
    
      // Check %after shape.
      if (reshape_after.getType().getShape() !=
          ArrayRef<int64_t>(llvm::to_vector(
              llvm::concat<const int64_t>(shape_b, shape_y1, shape_z)))) {
        return failure();
      }
    
      rewriter.replaceOpWithNewOp<mhlo::DotGeneralOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 26.9K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/unroll_batch_matmul.cc

      RankedTensorType tensorType = mlir::cast<RankedTensorType>(value.getType());
      Type element_type = tensorType.getElementType();
    
      int rank = tensorType.getShape().size();
      int num_rows = tensorType.getShape()[rank - 2];
      int num_cols = tensorType.getShape()[rank - 1];
    
      std::vector<Value> sliced;
    
      if (batch_size == 1) {
        // Batch size is 1, no splitting is required
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo_conversions/util.cc

                                       ConversionPatternRewriter& rewriter) {
      if (index_vector_dim == indices_type.getRank()) {
        llvm::SmallVector<int64_t, 4> new_start_indices_shape(
            indices_type.getShape().begin(), indices_type.getShape().end());
        new_start_indices_shape.push_back(1);
        indices_type = RankedTensorType::get(new_start_indices_shape,
                                             indices_type.getElementType());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/experimental/tac/transforms/device_transform_patterns.cc

      auto x_type = mlir::dyn_cast<RankedTensorType>(x.getType());
      auto y_type = mlir::dyn_cast<RankedTensorType>(y.getType());
      if (!x_type || !y_type) return failure();
      if (x_type.getShape() != y_type.getShape()) return failure();
    
      auto result_type = squared_diff_op.getType();
      if (!result_type) return failure();
    
      auto sub_op =
          rewriter.create<TF::SubOp>(squared_diff_op.getLoc(), result_type, x, y);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 25.4K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/tensor_array_ops_decomposition.cc

              // TensorArrayScatter `value`.
              auto t = scatter.getValue().getType().dyn_cast<RankedTensorType>();
              if (!t || t.getShape().empty()) return std::nullopt;
              return RankedTensorType::get(t.getShape().drop_front(),
                                           t.getElementType());
            } else if (auto gather =
                           llvm::dyn_cast<TF::TensorArrayGatherV3Op>(user)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Mar 02 20:41:19 UTC 2023
    - 40.2K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/utils/lstm_utils_test.cc

      auto output_types = fused_lstm_func_.getFunctionType().getResults();
      SmallVector<int64_t, 2> output_shape{1, mlir::ShapedType::kDynamic};
      EXPECT_EQ(mlir::cast<RankedTensorType>(output_types[0]).getShape().size(),
                output_shape.size());
      for (int i = 0; i < output_shape.size(); i++) {
        EXPECT_EQ(mlir::cast<RankedTensorType>(output_types[0]).getDimSize(i),
                  output_shape[i]);
      }
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10K bytes
    - Viewed (0)
Back to top