Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 44 for getRank (0.16 sec)

  1. tensorflow/compiler/mlir/tensorflow/transforms/tpu_partitioned_op_conversion.cc

      if (!(tensor_type && tensor_type.hasRank())) {
        return op->emitError()
               << "cannot convert op with unranked or non-tensor input type "
               << tensor_type << ".";
      }
    
      int rank = tensor_type.getRank();
      if (rank <= partition_dim) {
        return op->emitError() << "cannot partition " << first_operand_type
                               << " (rank = " << rank << ") along dimension "
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/unfold_large_splat_constant.cc

            op_builder->create<mlir::arith::ConstantOp>(
                const_op->getLoc(),
                DenseIntElementsAttr::get(
                    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>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/transforms/optimize_op_order.cc

        if (passthrough_op->hasTrait<OpTrait::IsTerminator>()) return failure();
    
        auto get_num_elements = [](RankedTensorType tensor) {
          int num_elements = 1;
          for (int i = 0; i < tensor.getRank(); ++i) {
            // Assume dynamic dim size as the dim size one.
            if (!tensor.isDynamicDim(i)) {
              num_elements *= tensor.getDimSize(i);
            }
          }
          return num_elements;
        };
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/tpu_annotate_dynamic_shape_inputs.cc

          BlockArgument arg = func.getArgument(index);
          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.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/ir/tf_arith_ops_folder.h

        // Scalar identity is broadcastable to any operand shape, we only need to
        // check that operand has the same shape as a result.
        bool scalar_identity = identity_ty.hasRank() && identity_ty.getRank() == 0;
        if (scalar_identity) return operand_ty == result_ty;
    
        // If identity is not a scalar, we must verify that identity shape is
        // statically known to be broadcastable to the operand shape and the operand
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/utils/utils.td

    // Checks if the value has rank at most 'n'.
    class HasRankAtLeast<int n> : Constraint<
        CPred<"$0.getType().cast<ShapedType>().hasRank() && "
              "$0.getType().cast<ShapedType>().getRank() >= " # n>>;
    
    // Checks value is not produced by a TFL_Quant or
    // from TFL_Quant Op with same quant type.
    def NotFromQuantOpOrSameQuantType : Constraint<
      CPred<"tflite::NotFromQuantOpOrSameQuantType($0,$1)">>;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/set_tpu_infeed_layout.cc

           * layout using the TPU API. Running legalize_tf.cc on non-TPU nodes
           * thus is a potential source of bugs.
           */
          minor_to_major.resize(t.getRank());
          std::iota(minor_to_major.begin(), minor_to_major.end(), 0);
          std::sort(minor_to_major.begin(), minor_to_major.end(),
                    [=](int64_t a, int64_t b) {
                      int64_t da = t.getDimSize(a);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/utils/fake_quant_utils.h

          return failure();
        }
    
        int quant_dim = -1;
        if (PerAxis) {
          // This is a special case that the quant_dim is the last dimensions.
          quant_dim = mlir::cast<ShapedType>(res.getType()).getRank() - 1;
        }
        // Use the min/max from the operands and the num_bits and narrow_range
        // attribute to create the quantization parameter for the new quantize op.
        rewriter.setInsertionPointAfter(tf_op.getOperation());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/tensorflow/utils/fake_quant_utils.h

            tf_op.emitError("The input should have known rank for per-channel op.");
            return failure();
          }
          // This is a special case that the quant_dim is the last dimensions.
          quant_dim = input_type.getRank() - 1;
        }
        // Use the min/max from the operands and the num_bits and narrow_range
        // attribute to create the quantization parameter for the new quantize op.
        rewriter.setInsertionPointAfter(tf_op.getOperation());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/quantization/tensorflow/tf_to_quant.cc

        if (PerAxis) {
          // This is a special case that the quant_dim is the last dimensions
          // according to the tf.FakeQuantWithMinMaxPerChannel.
          quant_dim = mlir::cast<ShapedType>(res.getType()).getRank() - 1;
        }
        // Use the min/max from the operands and the num_bits and narrow_range
        // attribute to create the quantization parameter for the new quantize op.
        rewriter.setInsertionPointAfter(tf_op.getOperation());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.1K bytes
    - Viewed (0)
Back to top