Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed DataSet.merge signature #6424

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -140,15 +140,15 @@ public static DataSet empty() {
* @param data the data to merge
* @return a single dataset
*/
public static DataSet merge(List<DataSet> data) {
public static DataSet merge(List<? extends org.nd4j.linalg.dataset.api.DataSet> data) {
if (data.isEmpty())
throw new IllegalArgumentException("Unable to merge empty dataset");

int nonEmpty = 0;
boolean anyFeaturesPreset = false;
boolean anyLabelsPreset = false;
boolean first = true;
for(DataSet ds : data){
for(org.nd4j.linalg.dataset.api.DataSet ds : data){
if(ds.isEmpty()){
continue;
}
Expand All @@ -171,7 +171,7 @@ public static DataSet merge(List<DataSet> data) {
INDArray[] featuresMasksToMerge = null;
INDArray[] labelsMasksToMerge = null;
int count = 0;
for (DataSet ds : data) {
for (org.nd4j.linalg.dataset.api.DataSet ds : data) {
if(ds.isEmpty())
continue;
featuresToMerge[count] = ds.getFeatures();
Expand Down Expand Up @@ -209,7 +209,7 @@ public static DataSet merge(List<DataSet> data) {
DataSet dataset = new DataSet(featuresOut, labelsOut, featuresMaskOut, labelsMaskOut);

List<Serializable> meta = null;
for (DataSet ds : data) {
for (org.nd4j.linalg.dataset.api.DataSet ds : data) {
if (ds.getExampleMetaData() == null || ds.getExampleMetaData().size() != ds.numExamples()) {
meta = null;
break;
Expand Down