Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 392 for asSlice (0.13 sec)

  1. test/fixedbugs/issue41500.go

    // the LICENSE file.
    
    package p
    
    type s struct {
    	slice []int
    }
    
    func f() {
    	var x *s
    
    	_ = x == nil || len(x.slice) // ERROR "invalid operation: .+ \(operator \|\| not defined on int\)|incompatible types|mismatched types untyped bool and int"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 17 02:30:22 UTC 2021
    - 867 bytes
    - Viewed (0)
  2. test/fixedbugs/issue10135.go

    // license that can be found in the LICENSE file.
    
    // Issue 10135: append a slice with zero-sized element used
    // to always return a slice with the same data pointer as the
    // old slice, even if it's nil, so this program used to panic
    // with nil pointer dereference because after append, s is a
    // slice with nil data pointer but non-zero len and cap.
    
    package main
    
    type empty struct{}
    
    func main() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 12 00:08:38 UTC 2015
    - 597 bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/tensorflow/tests/convert_tf_xla_op_to_tf_op.mlir

    // CHECK: %[[slice:.*]] = "tf.Slice"(%arg0, %[[tensor_scatter_update]], %[[arg2_i64]]) : (tensor<?x2xf32>, tensor<2xi64>, tensor<2xi64>) -> tensor<*xf32>
    // CHECK: %[[reshape:.*]] = "tf.Reshape"(%[[slice]], %[[cst_1]]) : (tensor<*xf32>, tensor<1xi64>) -> tensor<*xf32>
    // CHECK: return %[[reshape]] : tensor<*xf32>
    
    // -----
    
    // Tests that the converted `tf.Slice` has the correct number of dimensions
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Oct 30 06:52:55 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  4. test/convert4.go

    		func() {
    			_ = (*[9]byte)(s)
    		},
    		"runtime error: cannot convert slice with length 8 to array or pointer to array with length 9",
    	)
    	wantPanic(
    		func() {
    			_ = [9]byte(s)
    		},
    		"runtime error: cannot convert slice with length 8 to array or pointer to array with length 9",
    	)
    
    	var n []byte
    	if p := (*[0]byte)(n); p != nil {
    		panic("nil slice converted to *[0]byte should be nil")
    	}
    	_ = [0]byte(n)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 19 18:58:26 UTC 2022
    - 2.1K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/staticdata/embed.go

    		if kind == embedBytes {
    			objw.Uintptr(sym, off, uint64(size)) // cap for slice
    		}
    
    	case embedFiles:
    		slicedata := v.Sym().Pkg.Lookup(v.Sym().Name + `.files`).Linksym()
    		off := 0
    		// []files pointed at by Files
    		off = objw.SymPtr(slicedata, off, slicedata, 3*types.PtrSize) // []file, pointing just past slice
    		off = objw.Uintptr(slicedata, off, uint64(len(files)))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 10 18:22:02 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  6. pkg/slices/slices.go

    }
    
    // SortFunc sorts the slice x in ascending order as determined by the less function.
    // This sort is not guaranteed to be stable.
    // The slice is modified in place but returned.
    func SortFunc[E any](x []E, less func(a, b E) int) []E {
    	if len(x) <= 1 {
    		return x
    	}
    	slices.SortFunc(x, less)
    	return x
    }
    
    // SortStableFunc sorts the slice x while keeping the original order of equal element.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 15 06:28:11 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  7. pkg/apis/extensions/v1beta1/conversion.go

    		return err
    	}
    	if out.Ingress == nil {
    		// Produce a zero-length non-nil slice for compatibility with previous manual conversion.
    		out.Ingress = make([]networking.NetworkPolicyIngressRule, 0)
    	}
    	if out.Egress == nil {
    		// Produce a zero-length non-nil slice for compatibility with previous manual conversion.
    		out.Egress = make([]networking.NetworkPolicyEgressRule, 0)
    	}
    	return nil
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 07:16:15 UTC 2023
    - 8.1K bytes
    - Viewed (0)
  8. cmd/kube-controller-manager/app/options/endpointslicecontroller.go

    	fs.Int32Var(&o.MaxEndpointsPerSlice, "max-endpoints-per-slice", o.MaxEndpointsPerSlice, "The maximum number of endpoints that will be added to an EndpointSlice. More endpoints per slice will result in less endpoint slices, but larger resources. Defaults to 100.")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 03 07:16:42 UTC 2020
    - 3.7K bytes
    - Viewed (0)
  9. src/internal/unsafeheader/unsafeheader.go

    // Package unsafeheader contains header declarations for the Go runtime's slice
    // and string implementations.
    //
    // This package allows packages that cannot import "reflect" to use types that
    // are tested to be equivalent to reflect.SliceHeader and reflect.StringHeader.
    package unsafeheader
    
    import (
    	"unsafe"
    )
    
    // Slice is the runtime representation of a slice.
    // It cannot be used safely or portably and its representation may
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 16:14:17 UTC 2020
    - 1.1K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/sys/unix/sysvshm_unix.go

    	// Retrieve the size of the shared memory to enable slice creation
    	var info SysvShmDesc
    
    	_, err := SysvShmCtl(id, IPC_STAT, &info)
    	if err != nil {
    		// release the shared memory if we can't find the size
    
    		// ignoring error from shmdt as there's nothing sensible to return here
    		shmdt(addr)
    		return nil, err
    	}
    
    	// Use unsafe to convert addr into a []byte.
    	b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 16:12:58 UTC 2024
    - 1.4K bytes
    - Viewed (0)
Back to top