Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for ConvertToTensor (0.29 sec)

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

    Status ConvertToTensorProto(mlir::ElementsAttr attr,
                                TensorProto* output_tensor);
    
    // Converts an MLIR elements attribute to a TensorFlow tensor.
    Status ConvertToTensor(mlir::ElementsAttr attr, Tensor* output_tensor);
    
    }  // namespace tensorflow
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/cc/save_variables.cc

            "Operand idx 1 is not a tf.ConstOp. The initializing tensor is not "
            "saved to checkpoint.");
        return "";
      }
    
      Tensor const_tensor{};
      if (const absl::Status status = mlir::tfg::ConvertToTensor(
              /*attr=*/const_op.getValue(), /*output_tensor=*/&const_tensor);
          !status.ok()) {
        return status;
      }
    
      if (!bundle_writer.Add(/*key=*/var_handle_op.getSharedName(), const_tensor)
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Feb 26 03:36:55 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/utils/eval_util.cc

      }
    
      VLOG(1) << "Start to evaluate node: " << *node_def;
    
      // Adds inputs to the TF operation.
      for (const auto operand : operands) {
        Tensor tensor;
        RETURN_FAILURE_IF_ERROR(ConvertToTensor(operand, &tensor));
        TF_Tensor* tf_tensor = TF_TensorFromTensor(tensor, &status->status);
        RETURN_FAILURE_IF_ERROR(status);
        auto clean_tensor =
            MakeCleanup([tf_tensor] { TF_DeleteTensor(tf_tensor); });
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Dec 13 06:02:14 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/constant_fold_utils.cc

      std::vector<tensorflow::Tensor> inputs;
    
      // Adds inputs to the TF operation.
      for (const ElementsAttr& operand : operands) {
        tensorflow::Tensor tensor;
        RETURN_FAILURE_IF_ERROR(tensorflow::ConvertToTensor(operand, &tensor));
        inputs.push_back(std::move(tensor));
      }
    
      std::vector<tensorflow::TensorValue> input_values;
      for (tensorflow::Tensor& tensor : inputs) {
        input_values.emplace_back();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/utils/convert_tensor_test.cc

        TF_ASSERT_OK(value_or.status());
        auto attr = value_or.value();
    
        EXPECT_EQ(attr.getShapedType().getElementType(), expected_ty);
    
        Tensor out;
        TF_ASSERT_OK(ConvertToTensor(attr, &out));
    
        test::ExpectTensorEqual<T>(tensor, out);
      }
    };
    
    TEST_F(ConvertTensorTest, Simple) {
      mlir::MLIRContext context;
      RegisterDialects(context);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tf2xla/transforms/tf2xla_rewriter.cc

                                           std::to_string(operand_index));
    
      if (defining_op && matchPattern(defining_op, m_Constant(&const_attr))) {
        tensorflow::Tensor tensor;
        auto status = tensorflow::ConvertToTensor(const_attr, &tensor);
        if (!status.ok()) {
          op->emitRemark() << "skipping legalization due to failed const conversion"
                           << status.ToString();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:16:07 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/utils/convert_tensor.cc

          return errors::Unimplemented(absl::StrCat("Unimplemented data type ",
                                                    DataTypeString(output_dtype)));
      }
      return absl::OkStatus();
    }
    
    Status ConvertToTensor(const mlir::ElementsAttr attr, Tensor* output_tensor) {
      TensorProto tensor_proto;
      TF_RETURN_IF_ERROR(ConvertToTensorProto(attr, &tensor_proto));
      if (!output_tensor->FromProto(tensor_proto)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 20.5K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/convert_tf_quant_to_mhlo_int_test.cc

          return absl::InternalError("Failed to evaluate TF ops");
        }
    
        // Convert output tensor back to xla::Literal.
        tensorflow::Tensor tensor;
        TF_RETURN_IF_ERROR(tensorflow::ConvertToTensor(
            llvm::dyn_cast<TF::ConstOp>(fold_results[0].getDefiningOp()).getValue(),
            &tensor));
        xla::Shape xla_shape;
        TF_RETURN_IF_ERROR(tensorflow::TensorShapeToXLAShape(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 03 01:03:21 UTC 2024
    - 35.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/transforms/lower_static_tensor_list.cc

        // shape. The variant type should hold a TensorList.
        auto proto_attr = op.getValue().dyn_cast<TF::TensorProtoAttr>();
        if (!proto_attr) return failure();
        tensorflow::Tensor tensor;
        if (!tensorflow::ConvertToTensor(proto_attr, &tensor).ok())
          return failure();
        if (tensor.dtype() != tensorflow::DT_VARIANT) return failure();
        if (!tensorflow::TensorShapeUtils::IsScalar(tensor.shape()))
          return failure();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 20:00:43 UTC 2024
    - 70.7K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/flatbuffer_export.cc

          return empty_buffer_;
        }
        const_attribute_to_buffer_map_[attr] = index;
      }
    
      // TF doesn't currently support 4-bit types (DT_INT4), so we'll run into
      // trouble calling ConvertToTensor(). For now, extract the tensor data from
      // ElementsAttr directly in this and read type from tflite::TensorType instead
      // of tensorflow::DataType.
      auto type = mlir::cast<TensorType>(value.getType());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jun 12 21:41:49 UTC 2024
    - 164.5K bytes
    - Viewed (0)
Back to top