- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for dim (0.29 sec)
-
tensorflow/c/experimental/gradients/grad_test_helper.cc
auto num_dims_analytical = TF_NumDims(analytical_tensor); ASSERT_EQ(dims.size(), num_dims_analytical); for (int j = 0; j < num_dims_analytical; j++) { auto dim_analytical = TF_Dim(analytical_tensor, j); ASSERT_EQ(dims[j], dim_analytical); num_elem_analytical *= dim_analytical; } float* danalytical = new float[num_elem_analytical]{0}; memcpy(&danalytical[0], TF_TensorData(analytical_tensor),
C++ - Registered: Tue Mar 26 12:39:09 GMT 2024 - Last Modified: Wed Feb 28 13:53:47 GMT 2024 - 5K bytes - Viewed (0) -
tensorflow/c/eager/unified_api_test.cc
"Tensor expected to have rank 2 found rank: ", shape.dims()); } int64_t dim_sizes[] = {2, 4}; for (int i = 0; i < shape.dims(); i++) { if (shape.dim_size(i) != dim_sizes[i]) { return errors::InvalidArgument("Dim ", i, " expected to be of size ", dim_sizes[i], " found: ", shape.dim_size(i)); } } return absl::OkStatus(); }
C++ - Registered: Tue Apr 30 12:39:09 GMT 2024 - Last Modified: Tue Feb 27 13:57:45 GMT 2024 - 6.7K bytes - Viewed (0) -
tensorflow/c/experimental/gradients/nn_grad.cc
} auto imm_ctx = dyn_cast<ImmediateExecutionContext>(ctx); AbstractTensorPtr minus_1(imm_ctx->CreateInt32Scalar(-1)); ImmediateTensorHandlePtr dim(imm_ctx->CreateLocalHandle(minus_1.get())); AbstractTensorHandle* expand_dims_outputs; TF_RETURN_IF_ERROR( ops::ExpandDims(ctx, vec, dim.get(), &expand_dims_outputs, "ExpandDims")); TF_RETURN_IF_ERROR( ops::Mul(ctx, expand_dims_outputs, mat, &outputs[0], "Mul"));
C++ - Registered: Tue Mar 26 12:39:09 GMT 2024 - Last Modified: Wed Feb 28 13:53:47 GMT 2024 - 5.7K bytes - Viewed (0) -
tensorflow/c/eager/c_api.cc
} int64_t TFE_TensorHandleDim(TFE_TensorHandle* h, int dim_index, TF_Status* status) { if (h == nullptr) { status->status = tensorflow::errors::InvalidArgument("Invalid handle"); return -1; } int64_t dim = -1; status->status = tensorflow::unwrap(h)->Dim(dim_index, &dim); return dim; }
C++ - Registered: Tue Apr 30 12:39:09 GMT 2024 - Last Modified: Tue Mar 12 20:00:09 GMT 2024 - 43.9K bytes - Viewed (2) -
tensorflow/c/eager/parallel_device/parallel_device_lib.cc
int64_t axis_length = combined_shape.dim_size(axis_index); if (axis_length != component_shape.dim_size(axis_index)) { axis_length = -1; } TF_RETURN_IF_ERROR( combined_shape.SetDimWithStatus(axis_index, axis_length)); } } } auto dim_sizes = combined_shape.dim_sizes(); shape_ = std::vector<int64_t>(dim_sizes.begin(), dim_sizes.end()); }
C++ - Registered: Tue Apr 30 12:39:09 GMT 2024 - Last Modified: Fri Feb 09 07:47:20 GMT 2024 - 25.4K bytes - Viewed (1) -
tensorflow/c/eager/c_api_unified_experimental.cc
return nullptr; } tensorflow::PartialTensorShape partial_shape; if (shape.num_dims != -1) { DCHECK(shape.dim_sizes != nullptr); Status status = tensorflow::PartialTensorShape::MakePartialShape( reinterpret_cast<int64_t*>(shape.dim_sizes), shape.num_dims, &partial_shape); if (!status.ok()) { tsl::Set_TF_Status_from_Status(s, status); return nullptr; }
C++ - Registered: Tue Apr 30 12:39:09 GMT 2024 - Last Modified: Thu Feb 15 09:49:45 GMT 2024 - 9K bytes - Viewed (0) -
tensorflow/c/c_api.cc
const int64_t* dims) { if (num_dims != -1) { std::vector<tensorflow::shape_inference::DimensionHandle> dim_vec; dim_vec.reserve(num_dims); for (int i = 0; i < num_dims; ++i) { dim_vec.push_back(ic->MakeDim(dims[i])); } return ic->MakeShape(dim_vec); } else { return ic->UnknownShape(); } } } // namespace
C++ - Registered: Tue Apr 30 12:39:09 GMT 2024 - Last Modified: Mon Apr 15 03:35:10 GMT 2024 - 102.3K bytes - Viewed (0) -
tensorflow/c/c_api_test.cc
#undef EXPECT_TF_META TEST(CAPI, TestTensorAligned) { int64_t dim = 7; size_t tensor_size_bytes = dim * TF_DataTypeSize(TF_FLOAT); TF_Tensor* a = TF_AllocateTensor( /*dtype=*/TF_FLOAT, /*dims=*/&dim, /*num_dims=*/1, /*len=*/tensor_size_bytes); float* data = reinterpret_cast<float*>(TF_TensorData(a)); for (int i = 0; i < dim; ++i) { data[i] = 0; } if (TF_TensorDefaultAlignment() > 0) {
C++ - Registered: Tue Apr 30 12:39:09 GMT 2024 - Last Modified: Mon Apr 15 03:35:10 GMT 2024 - 96.9K bytes - Viewed (3) -
tensorflow/c/eager/gradient_checker.cc
} } // Fills out_dims with the dimensions of the given tensor. void GetDims(const TF_Tensor* t, int64_t* out_dims) { int num_dims = TF_NumDims(t); for (int i = 0; i < num_dims; i++) { out_dims[i] = TF_Dim(t, i); } } // Runs model as is if output is a scalar, // else sums the output tensor before returning. Status RunAndMaybeSum(AbstractContext* ctx, Model forward,
C++ - Registered: Tue Apr 30 12:39:09 GMT 2024 - Last Modified: Thu Feb 15 09:49:45 GMT 2024 - 7.3K bytes - Viewed (0) -
tensorflow/c/c_api_experimental.cc
status->status = InvalidArgument("Expected rank is ", num_dims, " but actual rank is ", rank); return; } for (int i = 0; i < num_dims; i++) { dims[i] = shape.dim_size(i); } } int TF_CheckpointReaderGetVariableNumDims(TF_CheckpointReader* reader, const char* name) { const auto& m = reader->GetVariableToShapeMap();
C++ - Registered: Tue Apr 30 12:39:09 GMT 2024 - Last Modified: Mon Apr 15 03:35:10 GMT 2024 - 29.4K bytes - Viewed (0)