Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 152 for clip (0.04 sec)

  1. src/slices/slices.go

    	if n < 0 {
    		panic("cannot be negative")
    	}
    	if n -= cap(s) - len(s); n > 0 {
    		s = append(s[:cap(s)], make([]E, n)...)[:len(s)]
    	}
    	return s
    }
    
    // Clip removes unused capacity from the slice, returning s[:len(s):len(s)].
    func Clip[S ~[]E, E any](s S) S {
    	return s[:len(s):len(s)]
    }
    
    // TODO: There are other rotate algorithms.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 29 14:01:59 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  2. src/image/draw/draw.go

    	clip(dst, &r, src, &sp, nil, nil)
    	if r.Empty() {
    		return
    	}
    	drawPaletted(dst, r, src, sp, true)
    }
    
    // clip clips r against each image's bounds (after translating into the
    // destination image's coordinate space) and shifts the points sp and mp by
    // the same amount as the change in r.Min.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 17:08:05 UTC 2024
    - 33.9K bytes
    - Viewed (0)
  3. src/slices/slices_test.go

    		t.Errorf("len(%v) = %d, want 3", s1, len(s1))
    	}
    	if cap(s1) < 6 {
    		t.Errorf("cap(%v[:3]) = %d, want >= 6", orig, cap(s1))
    	}
    	s2 := Clip(s1)
    	if !Equal(s1, s2) {
    		t.Errorf("Clip(%v) = %v, want %v", s1, s2, s1)
    	}
    	if cap(s2) != 3 {
    		t.Errorf("cap(Clip(%v)) = %d, want 3", orig, cap(s2))
    	}
    }
    
    func TestReverse(t *testing.T) {
    	even := []int{3, 1, 4, 1, 5, 9} // len = 6
    	Reverse(even)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:06 UTC 2024
    - 33.2K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_algorithm.py

        # is unusually small.
        if abs(zero_point) > 9e9:
          zero_point = 9e9
        if abs(scale) < 1e-9:
          scale = 1e-9
    
        zero_point = round(zero_point)
        quantized_hist_mids = np.clip(
            np.round(self._hist_mids / scale) + zero_point, minbound, maxbound
        )
        dequantized_hist_mids = scale * (quantized_hist_mids - zero_point)
        return dequantized_hist_mids
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Mar 11 19:29:56 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  5. src/cmd/go/main.go

    			telemetry.Inc("go/subcommand:" + strings.ReplaceAll(cfg.CmdName, " ", "-") + "-" + strings.Join(args[used:], "-"))
    			help.Help(os.Stdout, append(slices.Clip(args[:used]), args[used+1:]...))
    			base.Exit()
    		}
    		helpArg := ""
    		if used > 0 {
    			helpArg += " " + strings.Join(args[:used], " ")
    		}
    		cmdName := cfg.CmdName
    		if cmdName == "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:09:11 UTC 2024
    - 10K bytes
    - Viewed (0)
  6. samples/bookinfo/src/productpage/templates/productpage.html

                  </svg>
                  {% endfor %}
                  {% for n in range(5 - review.rating.stars) %}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 03 19:54:05 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  7. src/cmd/go/internal/load/test.go

    		ptest.EmbedFiles = str.StringList(p.EmbedFiles, p.TestEmbedFiles)
    		ptest.Internal.OrigImportPath = p.Internal.OrigImportPath
    		ptest.Internal.PGOProfile = p.Internal.PGOProfile
    		ptest.Internal.Build.Directives = append(slices.Clip(p.Internal.Build.Directives), p.Internal.Build.TestDirectives...)
    	} else {
    		ptest = p
    	}
    
    	// External test package.
    	if len(p.XTestGoFiles) > 0 {
    		pxtest = &Package{
    			PackagePublic: PackagePublic{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 14:01:23 UTC 2024
    - 28.2K bytes
    - Viewed (0)
  8. src/cmd/go/internal/generate/generate.go

    	if len(words) == 1 {
    		g.errorf("no command specified for -command")
    	}
    	command := words[1]
    	if g.commands[command] != nil {
    		g.errorf("command %q multiply defined", command)
    	}
    	g.commands[command] = slices.Clip(words[2:])
    }
    
    // exec runs the command specified by the argument. The first word is
    // the command name itself.
    func (g *Generator) exec(words []string) {
    	path := words[0]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 29 19:39:24 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  9. src/cmd/internal/moddeps/moddeps_test.go

    }
    
    // run runs the command and requires that it succeeds.
    func (r runner) run(t *testing.T, args ...string) {
    	t.Helper()
    	cmd := testenv.Command(t, args[0], args[1:]...)
    	cmd.Dir = r.Dir
    	cmd.Env = slices.Clip(r.Env)
    	if r.Dir != "" {
    		cmd.Env = append(cmd.Env, "PWD="+r.Dir)
    	}
    	out, err := cmd.CombinedOutput()
    	if err != nil {
    		t.Logf("> %s\n", strings.Join(args, " "))
    		t.Fatalf("command failed: %s\n%s", err, out)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 21 22:16:54 UTC 2024
    - 18.6K bytes
    - Viewed (0)
  10. src/image/jpeg/scan.go

    		case 3:
    			dst, stride = d.blackPix[8*(by*d.blackStride+bx):], d.blackStride
    		default:
    			return UnsupportedError("too many components")
    		}
    	}
    	// Level shift by +128, clip to [0, 255], and write to dst.
    	for y := 0; y < 8; y++ {
    		y8 := y * 8
    		yStride := y * stride
    		for x := 0; x < 8; x++ {
    			c := b[y8+x]
    			if c < -128 {
    				c = 0
    			} else if c > 127 {
    				c = 255
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 25 00:46:29 UTC 2024
    - 15.7K bytes
    - Viewed (0)
Back to top