Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. pkg/controller/deployment/util/hash_test.go

    	for i := 0; i < 1000; i++ {
    		specJSON := strings.Replace(podSpec, "@@VERSION@@", strconv.Itoa(i), 1)
    		spec := v1.PodTemplateSpec{}
    		json.Unmarshal([]byte(specJSON), &spec)
    		hash := controller.ComputeHash(&spec, nil)
    		if v, ok := seenHashes[hash]; ok {
    			t.Errorf("Hash collision, old: %d new: %d", v, i)
    			break
    		}
    		seenHashes[hash] = i
    	}
    }
    
    func BenchmarkAdler(b *testing.B) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jan 28 19:00:40 UTC 2019
    - 4K bytes
    - Viewed (0)
  2. tensorflow/cc/saved_model/fingerprinting.cc

      // Set fingerprint field #2.
      graph_regularization::SimpleDelete(*metagraph->mutable_graph_def());
      fingerprint_def.set_graph_def_program_hash(
          graph_regularization::ComputeHash(metagraph->graph_def()));
      // Set fingerprint field #3.
      fingerprint_def.set_signature_def_hash(
          RegularizeAndHashSignatureDefs(metagraph->signature_def()));
      // Set fingerprint field #4.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 26 00:24:44 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  3. src/runtime/map_test.go

    	vals := make([]val, 0, len(m))
    	runtime.MapValues(m, unsafe.Pointer(&vals))
    	for _, v := range vals {
    		if len(v.s) != 1 {
    			t.Errorf("len(v.s) == %d, want 1", len(v.s))
    		}
    	}
    }
    
    func computeHash() uintptr {
    	var v struct{}
    	return runtime.MemHash(unsafe.Pointer(&v), 0, unsafe.Sizeof(v))
    }
    
    func subprocessHash(t *testing.T, env string) uintptr {
    	t.Helper()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 33.5K bytes
    - Viewed (0)
  4. pkg/controller/controller_utils_test.go

    			template:            &v1.PodTemplateSpec{},
    			collisionCount:      nil,
    			otherCollisionCount: &maxCollisionCount,
    		},
    	}
    
    	for _, test := range tests {
    		hash := ComputeHash(test.template, test.collisionCount)
    		otherHash := ComputeHash(test.template, test.otherCollisionCount)
    
    		assert.NotEqual(t, hash, otherHash, "expected different hashes but got the same: %d", hash)
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 39.4K bytes
    - Viewed (0)
  5. pkg/controller/deployment/sync.go

    	}
    
    	if !createIfNotExisted {
    		return nil, nil
    	}
    
    	// new ReplicaSet does not exist, create one.
    	newRSTemplate := *d.Spec.Template.DeepCopy()
    	podTemplateSpecHash := controller.ComputeHash(&newRSTemplate, d.Status.CollisionCount)
    	newRSTemplate.Labels = labelsutil.CloneAndAddLabel(d.Spec.Template.Labels, apps.DefaultDeploymentUniqueLabelKey, podTemplateSpecHash)
    	// Add podTemplateHash label to selector.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 05 23:39:52 UTC 2023
    - 24.5K bytes
    - Viewed (0)
  6. pkg/controller/daemon/update.go

    func (dsc *DaemonSetsController) snapshot(ctx context.Context, ds *apps.DaemonSet, revision int64) (*apps.ControllerRevision, error) {
    	patch, err := getPatch(ds)
    	if err != nil {
    		return nil, err
    	}
    	hash := controller.ComputeHash(&ds.Spec.Template, ds.Status.CollisionCount)
    	name := ds.Name + "-" + hash
    	history := &apps.ControllerRevision{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:            name,
    			Namespace:       ds.Namespace,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 13 16:53:53 UTC 2024
    - 24.4K bytes
    - Viewed (0)
  7. pkg/controller/controller_utils.go

    	return err
    }
    
    // ComputeHash returns a hash value calculated from pod template and
    // a collisionCount to avoid hash collision. The hash will be safe encoded to
    // avoid bad words.
    func ComputeHash(template *v1.PodTemplateSpec, collisionCount *int32) string {
    	podTemplateSpecHasher := fnv.New32a()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 12 15:34:44 UTC 2024
    - 47.6K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/translate/export_graphdef.cc

          }
        }
      }
    }
    
    Status Exporter::AddInstructionNode(Operation* inst) {
      std::unique_ptr<NodeDef> node_def;
      int graph_hash_value = graph_regularization::ComputeHash(graphdef_);
      auto name = op_to_name_.GetUniqueName(inst, graph_hash_value);
      // Convert registered TF ops to NodeDef. Only registered ops are handled to
      // ensure that PopulateDerivedAttrs adds the correct attributes.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 01 11:17:36 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tf2xla/api/v2/tf_executor_to_graph.cc

          }
        }
      }
    }
    
    Status Exporter::AddInstructionNode(Operation* inst) {
      std::unique_ptr<NodeDef> node_def;
      int graph_hash_value = graph_regularization::ComputeHash(graphdef_);
      auto name = op_to_name_.GetUniqueName(inst, graph_hash_value);
      // Convert registered TF ops to NodeDef. Only registered ops are handled to
      // ensure that PopulateDerivedAttrs adds the correct attributes.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jun 06 23:04:51 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  10. pkg/controller/daemon/daemon_controller_test.go

    	// Add hash unique label to the pod
    	newLabels := label
    	var podSpec v1.PodSpec
    	// Copy pod spec from DaemonSet template, or use a default one if DaemonSet is nil
    	if ds != nil {
    		hash := controller.ComputeHash(&ds.Spec.Template, ds.Status.CollisionCount)
    		newLabels = labelsutil.CloneAndAddLabel(label, apps.DefaultDaemonSetUniqueLabelKey, hash)
    		podSpec = ds.Spec.Template.Spec
    	} else {
    		podSpec = v1.PodSpec{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 111.4K bytes
    - Viewed (0)
Back to top