Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ConvertToTensorProto (0.19 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/cc/const_op_size.cc

      return bytes_per_elem * const_value.getNumElements();
    }
    
    int64_t GetSizeOfStringConst(TF::ConstOp const_op) {
      const ElementsAttr const_value = const_op.getValue();
    
      // This cast is guaranteed to succeed. See `ConvertToTensorProto` from
      // tensorflow/core/ir/importexport/convert_tensor.cc.
      const auto str_attr = cast<DenseStringElementsAttr>(const_value);
    
      // Sum the sizes of each string.
      return absl::c_accumulate(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Dec 14 04:37:13 UTC 2022
    - 2.7K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/utils/convert_tensor.h

    absl::StatusOr<mlir::Attribute> ConvertTensorShapeProto(
        const TensorShapeProto& shape, mlir::MLIRContext* context);
    
    // Converts an MLIR elements attribute to a TensorFlow tensor proto.
    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);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/utils/export_utils.cc

      value->set_f(attr.getValueAsDouble());
      return absl::OkStatus();
    }
    
    Status ConvertAttribute(const mlir::ElementsAttr& attr, AttrValue* value) {
      return ConvertToTensorProto(attr, value->mutable_tensor());
    }
    
    Status ConvertAttribute(const mlir::TF::PlaceholderAttr& attr,
                            AttrValue* value) {
      value->set_placeholder(attr.getValue().str());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/utils/convert_tensor.cc

      } else {
        output->reserve(attr.getNumElements());
        for (const T value : attr.getValues<T>())
          output->push_back(Eigen::numext::bit_cast<uint8_t>(value));
      }
    }
    
    Status ConvertToTensorProto(const ElementsAttr attr, TensorProto* output) {
      auto type = attr.getShapedType();
      auto shape = type.getShape();
      DataType output_dtype;
      TF_RETURN_IF_ERROR(ConvertToDataType(type, &output_dtype));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 20.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/tensorflow/passes/quantize_composite_functions.cc

          // TODO(b/225793355): It adds TensorProtoAttr to the constant as a
          // workaround.
          tensorflow::TensorProto tensor_proto;
          if (!mlir::tfg::ConvertToTensorProto(
                   mlir::cast<ElementsAttr>(tensor_proto_attr), &tensor_proto)
                   .ok()) {
            return failure();
          }
    
          const int bit_width =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 54.5K bytes
    - Viewed (0)
Back to top