Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for add_attrs (0.12 sec)

  1. src/log/slog/record_test.go

    	r1 := NewRecord(time.Time{}, 0, "", 0)
    	r1.AddAttrs(intAttrs(0, nAttrsInline+1)...)
    	// Ensure that r1.back's capacity exceeds its length.
    	b := make([]Attr, len(r1.back), len(r1.back)+1)
    	copy(b, r1.back)
    	r1.back = b
    	// Make a copy that shares state.
    	r2 := r1
    	// Adding to both should insert a special Attr in the second.
    	r1AttrsBefore := attrsSlice(r1)
    	r1.AddAttrs(Int("p", 0))
    	r2.AddAttrs(Int("p", 1))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 15:10:55 UTC 2023
    - 4K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/cc/convert_asset_args_test.cc

      func::FuncOp main_func_op = GetMainFuncOp(*module_op);
      DictionaryAttr arg_attrs = main_func_op.getArgAttrDict(/*index=*/0);
    
      EXPECT_THAT(arg_attrs.get("tf_saved_model.bound_input"), IsNull());
    
      const ArrayRef<Attribute> index_path_attrs =
          mlir::cast<ArrayAttr>(arg_attrs.get("tf_saved_model.index_path"))
              .getValue();
      EXPECT_THAT(index_path_attrs, SizeIs(1));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  3. src/log/slog/record.go

    	for i := 0; i < r.nFront; i++ {
    		if !f(r.front[i]) {
    			return
    		}
    	}
    	for _, a := range r.back {
    		if !f(a) {
    			return
    		}
    	}
    }
    
    // AddAttrs appends the given Attrs to the [Record]'s list of Attrs.
    // It omits empty groups.
    func (r *Record) AddAttrs(attrs ...Attr) {
    	var i int
    	for i = 0; i < len(attrs) && r.nFront < len(r.front); i++ {
    		a := attrs[i]
    		if a.Value.isEmptyGroup() {
    			continue
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 16:30:56 UTC 2023
    - 6K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/cc/convert_asset_args.cc

    // Given argument attributes `arg_attrs`, returns a new set of argument
    // attributes where the "tf_saved_model.bound_input" attribute has been replaced
    // with the "tf_saved_model.index_path" attribute. `index_path` is the element
    // of the index path attribute.
    SmallVector<NamedAttribute> ReplaceBoundInputAttrWithIndexPathAttr(
        const ArrayRef<NamedAttribute> arg_attrs, const StringRef index_path,
        Builder& builder) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  5. src/net/addrselect.go

    	addrs    []IPAddr // addrs to sort
    	addrAttr []ipAttr
    	srcs     []netip.Addr // or not valid addr if unreachable
    	srcAttr  []ipAttr
    }
    
    func (s *byRFC6724) Len() int { return len(s.addrs) }
    
    func (s *byRFC6724) Swap(i, j int) {
    	s.addrs[i], s.addrs[j] = s.addrs[j], s.addrs[i]
    	s.srcs[i], s.srcs[j] = s.srcs[j], s.srcs[i]
    	s.addrAttr[i], s.addrAttr[j] = s.addrAttr[j], s.addrAttr[i]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 00:24:06 UTC 2024
    - 9.7K bytes
    - Viewed (0)
  6. src/log/slog/internal/benchmarks/handlers_test.go

    import (
    	"bytes"
    	"context"
    	"log/slog"
    	"slices"
    	"testing"
    )
    
    func TestHandlers(t *testing.T) {
    	ctx := context.Background()
    	r := slog.NewRecord(testTime, slog.LevelInfo, testMessage, 0)
    	r.AddAttrs(testAttrs...)
    	t.Run("text", func(t *testing.T) {
    		var b bytes.Buffer
    		h := newFastTextHandler(&b)
    		if err := h.Handle(ctx, r); err != nil {
    			t.Fatal(err)
    		}
    		got := b.String()
    		if got != wantText {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  7. tensorflow/compiler/jit/force_xla_constants_on_host_pass.cc

              flr, function, &fbody, &constant_arg_indices, &resource_arg_indices));
          VLOG(3) << "Found constant arg indices: "
                  << absl::StrJoin(constant_arg_indices, ", ");
    
          node->AddAttr("_input_hostmem", constant_arg_indices);
        }
      }
      return absl::OkStatus();
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 22 08:47:20 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  8. tensorflow/compiler/jit/force_xla_constants_on_host_pass_test.cc

      NameAttrList b_name_attr;
      b_name_attr.set_name("TransposeCall");
      ops::PartitionedCall call(root.WithOpName("call"), {in, perm}, {DT_FLOAT},
                                b_name_attr);
      call.output.front().node()->AddAttr(kXlaMustCompileAttr, true);
    
      std::unique_ptr<Graph> graph;
      TF_ASSERT_OK(ForceXlaConstantsOnHost(root, &flib_def, &graph));
    
      bool found = false;
      for (Node* node : graph->nodes()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 22 08:47:20 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  9. src/log/slog/json_handler_test.go

    		},
    	} {
    		t.Run(test.name, func(t *testing.T) {
    			var buf bytes.Buffer
    			h := NewJSONHandler(&buf, &test.opts)
    			r := NewRecord(testTime, LevelInfo, "m", 0)
    			r.AddAttrs(Int("a", 1), Any("m", map[string]int{"b": 2}))
    			if err := h.Handle(context.Background(), r); err != nil {
    				t.Fatal(err)
    			}
    			got := strings.TrimSuffix(buf.String(), "\n")
    			if got != test.want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jul 11 17:06:26 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  10. tensorflow/compiler/jit/cluster_scoping_pass.cc

      string scope;
      if (GetNodeAttr(node->attrs(), kXlaInternalScopeAttr, &scope).ok()) {
        return scope;
      }
    
      return std::nullopt;
    }
    
    void SetXlaInternalScope(Node* node, StringPiece scope) {
      node->AddAttr(kXlaInternalScopeAttr, scope);
    }
    
    // NB! We append a new scope as suffix to the _XlaInternalScope attribute
    // instead of overriding the old value.  In other words, appending scope B to
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 22 08:47:20 UTC 2024
    - 5.7K bytes
    - Viewed (0)
Back to top