Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 85 for num_elements (0.25 sec)

  1. tensorflow/cc/framework/ops.h

          typedef typename RealType<T>::type RealT;
          Tensor t(DataTypeToEnum<RealT>::v(), shape);
          if (t.NumElements() != static_cast<int64_t>(v.size())) {
            status = absl::InvalidArgumentError(absl::StrCat(
                "Cannot construct a tensor with ", t.NumElements(),
                " from an initializer list with ", v.size(), " elements"));
            return;
          }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Apr 13 05:57:22 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/jit/pjrt_device_context.cc

                                                  StatusCallback done) {
      tsl::profiler::TraceMe traceme("PjRtDeviceContext::CopyDeviceTensorToCPU");
      if (device_tensor->NumElements() == 0) {
        VLOG(2) << "CopyDeviceTensorToCPU empty tensor";
        done(absl::OkStatus());
        return;
      }
      auto literal = std::make_unique<xla::MutableBorrowingLiteral>();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Apr 13 08:49:31 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/api/meta/meta_test.go

    	metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
    
    	"github.com/google/go-cmp/cmp"
    	fuzz "github.com/google/gofuzz"
    )
    
    func TestAsPartialObjectMetadata(t *testing.T) {
    	f := fuzz.New().NilChance(.5).NumElements(0, 1).RandSource(rand.NewSource(1))
    
    	for i := 0; i < 100; i++ {
    		m := &metav1.ObjectMeta{}
    		f.Fuzz(m)
    		partial := AsPartialObjectMetadata(m)
    		if !reflect.DeepEqual(&partial.ObjectMeta, m) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/jit/pjrt_tensor_buffer_util_test.cc

                   ->pjrt_context->CopyDeviceTensorToCPUSync(&tensor, "", device,
                                                             &dest_cpu_tensor);
      for (int i = 0; i < tensor.NumElements(); ++i) {
        EXPECT_EQ(dest_cpu_tensor.flat<int32_t>().data()[i], data[i]);
      }
    }
    
    }  // namespace
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Sep 14 18:14:47 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  5. src/crypto/x509/root_windows.go

    	}
    
    	simpleChains := unsafe.Slice(simpleChain, count)
    	lastChain := simpleChains[count-1]
    	elements := unsafe.Slice(lastChain.Elements, lastChain.NumElements)
    	for i := 0; i < int(lastChain.NumElements); i++ {
    		// Copy the buf, since ParseCertificate does not create its own copy.
    		cert := elements[i].CertContext
    		encodedCert := unsafe.Slice(cert.EncodedCert, cert.Length)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 09 19:41:40 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  6. tensorflow/cc/framework/gradients_test.cc

      ClientSession session(scope_test_);
      std::vector<Tensor> grad_result;
      TF_EXPECT_OK(session.Run({{x, {3.0f}}}, grad_outputs, &grad_result));
      EXPECT_EQ(grad_result.size(), 1);
      EXPECT_EQ(grad_result[0].NumElements(), 1);
      EXPECT_EQ(grad_result[0].flat<float>()(0), 17502.0f);
    }
    
    TEST_F(GradientsTest, MultiOutputNodeDependentOutputs) {
      auto x = Placeholder(scope_test_, DT_FLOAT);
      auto y0 = Square(scope_test_, x);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Apr 15 15:13:38 UTC 2023
    - 25K bytes
    - Viewed (0)
  7. src/encoding/asn1/asn1.go

    		if invalidLength(offset, t.length, len(bytes)) {
    			err = SyntaxError{"truncated sequence"}
    			return
    		}
    		offset += t.length
    		numElements++
    	}
    	ret = reflect.MakeSlice(sliceType, numElements, numElements)
    	params := fieldParameters{}
    	offset := 0
    	for i := 0; i < numElements; i++ {
    		offset, err = parseField(ret.Index(i), bytes, offset, params)
    		if err != nil {
    			return
    		}
    	}
    	return
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 31.8K bytes
    - Viewed (0)
  8. tensorflow/compiler/jit/xla_tensor.cc

    #include "tensorflow/compiler/tf2xla/shape_util.h"
    #include "xla/shape_util.h"
    
    namespace tensorflow {
    
    /*static*/ XlaTensor* XlaTensor::FromTensor(const Tensor* tensor) {
      if (tensor->NumElements() == 0) {
        return nullptr;
      }
      XlaTensor* xla_tensor =
          FromOpaquePointer(const_cast<char*>(tensor->tensor_data().data()));
      return xla_tensor;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 22 08:47:20 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  9. tensorflow/c/tf_tensor_internal.h

      ~TensorInterface() override {}
    
      void Release() override;
    
      DataType Type() const override;
      int NumDims() const override;
      int64_t Dim(int dim_index) const override;
      int64_t NumElements() const override;
      size_t ByteSize() const override;
      void* Data() const override;
      bool IsAligned() const override;
      bool CanMove() const override;
      std::string SummarizeValue() const override;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Aug 24 20:38:55 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  10. tensorflow/compiler/jit/increase_dynamism_for_auto_jit_pass.cc

    };
    
    std::vector<int64_t> IntTensorAsVector(const Tensor& t) {
      DCHECK(t.dtype() == DT_INT32 || t.dtype() == DT_INT64);
      std::vector<int64_t> result;
      result.reserve(t.NumElements());
      for (int i = 0; i < t.NumElements(); i++) {
        int64_t element = t.dtype() == DT_INT32
                              ? static_cast<int64_t>(t.flat<int32>()(i))
                              : t.flat<int64_t>()(i);
        result.push_back(element);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 12 06:33:33 UTC 2024
    - 13.8K bytes
    - Viewed (0)
Back to top