- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 20 for num_dims (0.06 sec)
-
tensorflow/c/eager/gradient_checker.cc
int32_t step = 1) { for (int32_t i = start; i < end; i += step) { (*data)[i] = i; } } // 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.
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 7.3K bytes - Viewed (0) -
tensorflow/c/eager/gradients.cc
const int64_t** dims, const int* num_dims, int num_values, ForwardOperation* forward_op_) { std::unique_ptr<TensorShapeProto[]> proto(new TensorShapeProto[num_values]); for (int i = 0; i < num_values; ++i) { const auto num_dims_i = num_dims[i]; if (num_dims_i > TensorShape::MaxDimensions()) { return errors::InvalidArgument(
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 19.7K bytes - Viewed (0) -
tensorflow/c/eager/c_api_unified_experimental_graph.cc
DCHECK(shape != nullptr); TF_Status status; int num_dims = TF_GraphGetTensorNumDims(graph_, output_, &status); DCHECK_GE(num_dims, -1); TF_RETURN_IF_ERROR(StatusFromTF_Status(&status)); if (num_dims == kUnknownRank) { return absl::OkStatus(); } std::vector<int64_t> dims(num_dims, kUnknownDim); TF_GraphGetTensorShape(graph_, output_,
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 15.7K bytes - Viewed (0) -
tensorflow/c/c_api_experimental.cc
const int64_t* dims, int num_dims) { DCHECK(index >= 0 && index < shape_list->num_items); TF_ShapeAndType& shape = shape_list->items[index]; DCHECK(shape.dims == nullptr) << "Shape at " << index << " is already set!"; DCHECK(num_dims >= 0) << "Number of dimensions cannot be negative!"; shape.num_dims = num_dims; shape.dims = new int64_t[num_dims]; memcpy(shape.dims, dims, sizeof(int64_t) * num_dims);
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 16:27:48 UTC 2024 - 29.5K bytes - Viewed (0) -
tensorflow/c/eager/c_api.cc
} else { const auto num_dims = tensor_shape.dim_size(); std::unique_ptr<int64_t[]> dims(new int64_t[num_dims]); for (int i = 0; i < num_dims; ++i) { dims[i] = tensor_shape.dim(i).size(); } TFE_OpSetAttrShape(op, attr_name, dims.get(), num_dims, status); } } break; case tensorflow::AttrValue::kFunc: {
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 43.9K bytes - Viewed (0) -
tensorflow/c/eager/c_api_unified_experimental_test.cc
// Build an abstract input tensor. int64_t dims[] = {2, 2}; // Matrices will be 2 x 2 int num_dims = sizeof(dims) / sizeof(dims[0]); float vals[] = {0.0f, 0.0f, 0.0f, 0.0f}; TFE_Context* eager_ctx = TF_ExecutionContextGetTFEContext(ctx, status.get()); TFE_TensorHandle* t = TestMatrixTensorHandleWithInput(eager_ctx, vals, dims, num_dims); TF_AbstractTensor* at = TF_CreateAbstractTensorFromEagerTensor(
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 39.1K bytes - Viewed (0) -
tensorflow/c/eager/gradients_internal.h
DataType value, ForwardOperation*); absl::Status SetAttrShape(AbstractOperation*, const char* attr_name, const int64_t* dims, const int num_dims, ForwardOperation*); absl::Status SetAttrFunction(AbstractOperation*, const char* attr_name, const AbstractOperation* value, ForwardOperation*);
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 4.7K bytes - Viewed (0) -
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;
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 9K bytes - Viewed (0) -
tensorflow/c/eager/dlpack.cc
return nullptr; } size_t total_bytes = dl_tensor->dtype.bits / 8; for (int i = 0; i < num_dims; i++) { total_bytes *= dims[i]; } if (dl_tensor->strides != nullptr && !IsValidStrideCompactRowMajorData(dl_tensor->shape, dl_tensor->strides, num_dims)) { status->status = tensorflow::errors::InvalidArgument( "Invalid strides array from DLPack");
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 05:11:17 UTC 2024 - 12.9K bytes - Viewed (0) -
tensorflow/c/c_api_test.cc
TEST(CAPI, TestTensorNonScalarBytesAllocateDelete) { const int batch_size = 4; const int num_dims = 2; int64_t* dims = new int64_t[num_dims]; int64_t num_elements = 1; dims[0] = batch_size; dims[1] = 1; for (int64_t i = 0; i < num_dims; ++i) { num_elements *= dims[i]; } TF_Tensor* t = TF_AllocateTensor(TF_STRING, dims, num_dims, sizeof(TF_TString) * num_elements);
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Sat Oct 12 16:27:48 UTC 2024 - 97K bytes - Viewed (0)