tensorflow/core/kernels/composite_tensor_variant_test.cc
// Returns an CompositeTensorVariant encoding for a 2D ragged tensor with
// the specified values and row_splits.
Returns an CompositeTensorVariant encoding for a 2D ragged tensor with
the specified values and row_splits.
Returns an CompositeTensorVariant encoding for a 2D ragged tensor with the specified values and row_splits .
CompositeTensorVariant Make2DRaggedTensor(const std::vector<int32>& values,
                                          const std::vector<int64_t>& splits) {
  CompositeTensorVariantMetadata metadata;
  EXPECT_TRUE(
      protobuf::TextFormat::ParseFromString(k2DRaggedTensorSpec, &metadata));
  std::vector<Tensor> components;
  components.push_back(test::AsTensor<int32>(values));
  components.push_back(test::AsTensor<int64_t>(splits));
  CompositeTensorVariant v(metadata, absl::MakeSpan(components));
  return v;
}
CompositeTensorVariant Make2DRaggedTensor ( const std :: vector < int32 > & values , const std :: vector < int64_t > & splits ) { CompositeTensorVariantMetadata metadata ; EXPECT_TRUE ( protobuf :: TextFormat :: ParseFromString ( k2DRaggedTensorSpec , & metadata ) ) ; std :: vector < Tensor > components ; components . push_back ( test :: AsTensor < int32 > ( values ) ) ; components . push_back ( test :: AsTensor < int64_t > ( splits ) ) ; CompositeTensorVariant v ( metadata , absl :: MakeSpan ( components ) ) ; return v ; }
Returns an CompositeTensorVariant encoding for a 2D ragged tensor with
the specified values and row_splits.
Returns an CompositeTensorVariant encoding for a 2D ragged tensor with the specified values and row_splits .