Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for mutable_tensor_shape (0.31 sec)

  1. tensorflow/c/kernels_test.cc

      struct TensorProtoHelpers {
       public:
        static ::tensorflow::TensorProto GenerateTensorProto() {
          ::tensorflow::TensorProto tensor_proto;
          tensor_proto.mutable_tensor_shape()->add_dim()->set_size(2);
          tensor_proto.mutable_tensor_shape()->add_dim()->set_size(3);
          tensor_proto.set_dtype(DT_INT32);
          tensor_proto.add_int_val(1);
          tensor_proto.add_int_val(2);
          tensor_proto.add_int_val(3);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Sep 06 19:12:29 UTC 2023
    - 50.4K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/utils/constant_utils.cc

        auto etype = complex_type.getElementType();
        if (etype.isF32()) {
          tensorflow::TensorProto repr;
          repr.set_dtype(tensorflow::DT_COMPLEX64);
    
          tensorflow::TensorShapeProto* shape = repr.mutable_tensor_shape();
          shape->set_unknown_rank(false);
          shape->add_dim()->set_size(int64_t{1});
          std::string content;
          auto complex_value = std::complex<float>(static_cast<float>(value), 0.0f);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  3. tensorflow/cc/ops/const_op_test.cc

    }
    
    TEST(ConstOpTest, FromProto) {
      Scope root = Scope::NewRootScope();
      TensorProto proto;
      proto.set_dtype(DT_DOUBLE);
      TensorShape({2, 2}).AsProto(proto.mutable_tensor_shape());
      for (int i = 0; i < 4; ++i) {
        proto.add_double_val(static_cast<double>(i));
      }
      auto c = ops::ConstFromProto(root, proto);
      TF_CHECK_OK(root.status());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Aug 12 14:38:21 UTC 2019
    - 4.9K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/utils/convert_tensor.cc

        // Attribute for that proto, and finally splat the Attribute.
    
        TensorProto tensor_copy = input_tensor;
        auto* shape = tensor_copy.mutable_tensor_shape();
        shape->clear_dim();
        shape->add_dim()->set_size(1);
    
        TF_ASSIGN_OR_RETURN(ElementsAttr single_attr,
                            ConvertTensorProto(tensor_copy, builder));
    
    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/tensorflow/utils/convert_tensor_test.cc

      // them 42. Our conversion routine should not materialize these elements when
      // creating the Attribute. If it tries to, we'll crash OOM here.
      TensorProto tensor;
      tensor.set_dtype(DT_FLOAT);
      tensor.mutable_tensor_shape()->add_dim()->set_size(1ULL << 35);
      tensor.add_float_val(42.0);
    
      mlir::MLIRContext context;
      mlir::Builder builder(&context);
      TF_ASSERT_OK_AND_ASSIGN(mlir::ElementsAttr attribute,
    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/jit/shape_inference.cc

              DataType dtype = n->output_type(0);
              AddNodeAttr("dtype", dtype, &const_def);
              TensorProto value;
              value.set_dtype(dtype);
              value.mutable_tensor_shape()->add_dim()->set_size(
                  shape_proto.dim_size());
              for (const auto& dim : shape_proto.dim()) {
                if (dtype == DT_INT32) {
                  value.add_int_val(dim.size());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 31 00:41:19 UTC 2024
    - 13K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/utils/const_tensor_utils.cc

        const TensorT& tensor, const std::vector<uint8_t>& buffer) {
      tensorflow::TensorProto ret;
      ret.set_dtype(TflTypeToTfType(tensor.type));
    
      tensorflow::TensorShapeProto* shape = ret.mutable_tensor_shape();
      shape->set_unknown_rank(false);
      for (auto dim : tensor.shape) {
        shape->add_dim()->set_size(int64_t{dim});
      }
      // TensorFlow Lite uses tflite::DynamicBufer to encode vector of strings.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 07 23:04:40 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/flatbuffer_import.cc

      tensorflow::TensorProto repr = tfl::ConvertTfliteConstTensor(tensor, buffer);
      repr.clear_tensor_shape();
      if (tfl::IsQuantized(tensor)) {
        repr.mutable_tensor_shape()->add_dim()->set_size(buffer.size());
        repr.set_dtype(tensorflow::DT_INT8);
      } else {
        repr.mutable_tensor_shape()->add_dim()->set_size(
            buffer.size() / (shaped_type.getElementTypeBitWidth() / CHAR_BIT));
      }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 21 18:21:50 UTC 2024
    - 66.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/jit/extract_outside_compilation_pass_test.cc

        tensorflow::TensorProto tensor_proto;
        tensor_proto.set_dtype(tensorflow::DT_INT32);
        tensorflow::TensorShapeProto shape;
        shape.add_dim()->set_size(2);
        *tensor_proto.mutable_tensor_shape() = shape;
        for (int i = 0; i < 2; ++i) {
          tensor_proto.add_int_val(1);
        }
        NodeDef const_def;
        TF_CHECK_OK(NodeDefBuilder("const", "Const")
                        .Attr("dtype", DT_INT32)
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Sep 06 19:12:29 UTC 2023
    - 41K bytes
    - Viewed (0)
  10. tensorflow/compiler/jit/encapsulate_subgraphs_pass.cc

                             const TensorShapeProto& shape, Graph* graph_out) {
      DataType data_type = src_node->output_type(src_port);
      TensorProto dummy_proto;
      dummy_proto.set_dtype(data_type);
      *dummy_proto.mutable_tensor_shape() = shape;
      // Don't set any value field in the proto, since it is only going to be used
      // for shape inference.
    
      GraphDefBuilder::Options options(graph_out, /*status=*/nullptr);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 22 08:47:20 UTC 2024
    - 51K bytes
    - Viewed (0)
Back to top