Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for ConvertToDataType (0.23 sec)

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

    // Converts an MLIR type to TensorFlow DataType. If 'type' is a scalar type, it
    // is converted directly. If it is a shaped type, the element type is converted.
    Status ConvertToDataType(mlir::Type type, DataType* dtype);
    
    // Converts an TensorFlow shape to the one used in MLIR.
    void ConvertToMlirShape(const TensorShape& input_shape,
                            llvm::SmallVectorImpl<int64_t>* shape);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tf2xla/internal/utils/test_metadata_config.cc

        TF_RETURN_IF_ERROR(tensorflow::TensorShape::BuildTensorShape(
            xla_shape.dimensions(), &tensor_shape));
        arg_shapes.emplace_back(tensor_shape);
    
        DataType dtype;
        TF_RETURN_IF_ERROR(ConvertToDataType(input_type, &dtype));
    
        auto metadata_arg = metadata_proto.add_args();
        metadata_arg->set_kind(tpu::TPUCompileMetadataProto::Arg::PARAMETER);
        metadata_arg->set_dtype(dtype);
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jun 13 23:59:33 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/utils/convert_type.cc

      }
    // NOLINTNEXTLINE
    #include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.def"
    
      return errors::Unimplemented(
          absl::StrCat("Converting ", debugString(type), " to DataType"));
    }
    
    Status ConvertToDataType(Type type, DataType* dtype) {
      if (auto stype = mlir::dyn_cast<ShapedType>(type)) {
        TF_RETURN_IF_ERROR(
            ConvertScalarTypeToDataType(stype.getElementType(), dtype));
      } else {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/host_runtime/tpu_metadata_utils.cc

        int index = operand_type_and_idx.index();
        tensorflow::tpu::TPUCompileMetadataProto::Arg* arg = metadata->add_args();
        tensorflow::DataType dtype;
        tensorflow::Status status =
            tensorflow::ConvertToDataType(operand_type, &dtype);
        if (!status.ok())
          return op.emitOpError(
              llvm::formatv("failed to determine operand type at index {0}: {1}",
                            index, status.message()));
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tensorflow/utils/convert_tensor.cc

      return mlir::TF::ShapeAttr::get(type.getContext(), ArrayRef<int64_t>());
    }
    
    absl::StatusOr<TensorSpecProto> ConvertTypeToTensorSpecProto(
        const mlir::Type& type) {
      DataType dtype;
      TF_RETURN_IF_ERROR(ConvertToDataType(type, &dtype));
      TensorSpecProto tensor_spec;
      tensor_spec.set_dtype(dtype);
      *tensor_spec.mutable_shape() = ConvertTypeToTensorShape(type).AsProto();
      return tensor_spec;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 20.5K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/translate/export_graphdef.cc

        if (!subtypes.empty()) {
          AttrValue handle_dtypes_attr;
          AttrValue handle_shapes_attr;
          for (mlir::TensorType subtype : subtypes) {
            DataType dtype;
            TF_RETURN_IF_ERROR(ConvertToDataType(subtype.getElementType(), &dtype));
            handle_dtypes_attr.mutable_list()->add_type(dtype);
    
            SetTensorShapeProto(subtype,
                                handle_shapes_attr.mutable_list()->add_shape());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 01 11:17:36 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tf2xla/api/v2/tf_executor_to_graph.cc

        if (!subtypes.empty()) {
          AttrValue handle_dtypes_attr;
          AttrValue handle_shapes_attr;
          for (mlir::TensorType subtype : subtypes) {
            DataType dtype;
            TF_RETURN_IF_ERROR(ConvertToDataType(subtype.getElementType(), &dtype));
            handle_dtypes_attr.mutable_list()->add_type(dtype);
    
            SetTensorShapeProto(subtype,
                                handle_shapes_attr.mutable_list()->add_shape());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jun 06 23:04:51 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tf2xla/api/v1/compile_mlir_util.cc

          TF_RETURN_IF_ERROR(ConvertToDataType(tensor_type, &resource_update.type));
          TF_RETURN_IF_ERROR(XLAShapeToTensorShape(shape, &resource_update.shape));
          continue;
        }
        // Construct OutputDescription for result.
        outputs->emplace_back();
        XlaOutputDescription& out_desc = outputs->back();
        TF_RETURN_IF_ERROR(ConvertToDataType(tensor_type, &out_desc.type));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 21 17:24:39 UTC 2024
    - 45.3K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tf2xla/transforms/tf2xla_rewriter.cc

          return tensorflow::XlaExpression::Invalid();
        }
    
        return tensorflow::XlaExpression::Constant(tensor);
      }
    
      tensorflow::DataType dtype;
      auto status = tensorflow::ConvertToDataType(operand.getType(), &dtype);
      if (!status.ok()) {
        op->emitRemark() << "skipping legalization due to " << status.ToString();
        return tensorflow::XlaExpression::Invalid();
      }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:16:07 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/utils/export_utils.cc

      }
      return absl::OkStatus();
    }
    
    Status ConvertAttribute(mlir::Type type, bool remove_ref_type,
                            AttrValue* value) {
      DataType dtype;
      TF_RETURN_IF_ERROR(ConvertToDataType(type, &dtype));
      if (tensorflow::IsRefType(dtype)) dtype = tensorflow::RemoveRefType(dtype);
      value->set_type(dtype);
      return absl::OkStatus();
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 19.7K bytes
    - Viewed (0)
Back to top