Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 46 for shape_of (0.14 sec)

  1. tensorflow/compiler/mlir/tf2xla/transforms/tf2xla_rewriter.cc

                 << operand.getType();
        }
    
        auto shape_or = expr.GetShape();
        if (!shape_or.ok()) {
          return op_->emitRemark()
                 << "failed to get shape for expression. " << expr.HumanString();
        }
    
        tensors.emplace_back(
            device_->GetAllocator(tensorflow::AllocatorAttributes()), expr.dtype(),
            shape_or.value());
    
        tensorflow::Tensor& tensor = tensors.back();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:16:07 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/transforms/host_runtime/tpu_rewrite_pass.cc

            metadata.args(operand_and_idx.index()).shape());
        if (shape.IsFullyDefined()) continue;
    
        auto shape_op = builder->create<TF::ShapeOp>(
            cluster_func.getLoc(),
            tensorflow::GetTypeFromTFTensorShape({-1}, builder->getIntegerType(64)),
            operand_and_idx.value());
        compile_op_operands.emplace_back(shape_op.getResult());
      }
    
      FlatSymbolRefAttr func_attr = cluster_func.getFuncAttr();
      func::FuncOp func =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 21:25:12 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  3. tensorflow/c/eager/c_api_experimental_test.cc

        ASSERT_TRUE(TF_GetCode(status.get()) == TF_OK) << TF_Message(status.get());
    
        TFE_Op* shape_op = ShapeOp(ctx, hgpu);
        TFE_OpSetDevice(shape_op, gpu_device_name.c_str(), status.get());
        ASSERT_TRUE(TF_GetCode(status.get()) == TF_OK) << TF_Message(status.get());
        TFE_TensorHandle* retvals[1];
        int num_retvals = 1;
        TFE_Execute(shape_op, &retvals[0], &num_retvals, status.get());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Aug 03 03:14:26 UTC 2023
    - 31.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tf2xla/transforms/legalize_tf.cc

      auto element_type = x.getElementType();
      auto shape_x = x.getShape();
      auto shape_y = y.getShape();
    
      if (shape_x.size() == shape_y.size()) {
        llvm::SmallVector<int64_t, 4> out_shape(shape_x.size());
        for (int i = 0; i < shape_x.size(); i++) {
          auto x_val = shape_x[i];
          auto y_val = shape_y[i];
          out_shape[i] = std::max(x_val, y_val);
        }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 20:00:43 UTC 2024
    - 291.8K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/tensorflow/passes/duplicate_shape_determining_constants.cc

    // or bounded from the XLA compiler's perspective, even if it is not a
    // `ConstOp`.
    bool IsOutputCompileTimeConstantOrBounded(Operation* op) {
      return llvm::isa_and_nonnull<TF::ShapeOp, TF::ShapeNOp, TF::RankOp,
                                   TF::SizeOp, TF::TensorArraySizeV3Op,
                                   TF::XlaSetBoundOp>(op);
    }
    
    // Recursively duplicate constants for `op_operands` upward.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 22 05:52:39 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/ir/tfl_ops.cc

      auto element_ty = input_ty.getElementType();
      output_ty = UnrankedTensorType::get(element_ty);
    
      auto shape_ty = shape.getType().dyn_cast<RankedTensorType>();
      if (!shape_ty) return success();
      if (shape_ty.getRank() != 1)
        return error_handler(llvm::formatv(
            "requires 'shape' to be rank 1, but got {0}", shape_ty.getRank()));
    
      DenseIntElementsAttr shape_attr;
      if (!matchPattern(shape, m_Constant(&shape_attr))) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:41:17 UTC 2024
    - 169.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/flatbuffer_export.cc

        llvm::ArrayRef<int64_t> shape_ref =
            mlir::cast<TensorType>(tensor_attr.getType()).getShape();
        if (mlir::failed(check_shape(shape_ref))) return std::nullopt;
    
        shape = std::vector<int32_t>(shape_ref.begin(), shape_ref.end());
      } else if (type.hasRank()) {
        llvm::ArrayRef<int64_t> shape_ref = type.getShape();
        if (mlir::failed(check_shape(shape_ref))) return std::nullopt;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:41:49 UTC 2024
    - 164.5K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tf2xla/internal/passes/mark_ops_for_outside_compilation.cc

          OperationName(mlir::TF::RankOp::getOperationName(), context),
          OperationName(mlir::TF::RangeOp::getOperationName(), context),
          OperationName(mlir::TF::ShapeOp::getOperationName(), context),
          OperationName(mlir::TF::ShapeNOp::getOperationName(), context),
          OperationName(mlir::TF::SizeOp::getOperationName(), context),
      };
    
      supported_ops->insert(allowlist_ops.begin(), allowlist_ops.end());
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 21.4K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/tensor_list_ops_decomposition.cc

    // returns an error.
    LogicalResult GetConstShapeValue(Value shape_value,
                                     llvm::SmallVector<int64_t, 8>* shape) {
      auto shape_op = shape_value.getDefiningOp();
      if (!shape_op) return failure();
      auto shape_const_op = llvm::dyn_cast<TF::ConstOp>(shape_op);
      if (!shape_const_op) return failure();
      for (const auto& v : shape_const_op.getValue().getValues<APInt>()) {
        int64_t dim_size = v.getSExtValue();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 39.2K bytes
    - Viewed (0)
  10. tensorflow/c/experimental/saved_model/internal/saved_model_api_test.cc

          TF_SignatureDefParamTensorSpec(param_out);
      const TF_Shape* shape_out = TF_TensorSpecShape(tensor_spec_out);
    
      // Output "output_0" is a scalar, float32 tensor
      EXPECT_EQ("output_0", std::string(TF_SignatureDefParamName(param_out)));
      EXPECT_EQ(TF_FLOAT, TF_TensorSpecDataType(tensor_spec_out));
      EXPECT_EQ(0, TF_ShapeDims(shape_out));
    
      std::vector<TFE_TensorHandle*> compute_fn_inputs;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 23 08:08:45 UTC 2024
    - 21.3K bytes
    - Viewed (0)
Back to top