tf.contrib.data.sample_from_datasets
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
Samples elements at random from the datasets in datasets. (deprecated)
tf.contrib.data.sample_from_datasets(
    datasets, weights=None, seed=None
)
| Args | 
|---|
| datasets | A list of tf.data.Datasetobjects with compatible structure. | 
| weights | (Optional.) A list of len(datasets)floating-point values whereweights[i]represents the probability with which an element should be
sampled fromdatasets[i], or atf.data.Datasetobject where each
element is such a list. Defaults to a uniform distribution acrossdatasets. | 
| seed | (Optional.) A tf.int64scalartf.Tensor, representing the
random seed that will be used to create the distribution. Seetf.compat.v1.set_random_seedfor behavior. | 
| Returns | 
|---|
| A dataset that interleaves elements from datasetsat random, according toweightsif provided, otherwise with uniform probability. | 
| Raises | 
|---|
| TypeError | If the datasetsorweightsarguments have the wrong type. | 
| ValueError | If the weightsargument is specified and does not match the
length of thedatasetselement. | 
  
  
 
  
    
    
      
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2020-10-01 UTC.
  
  
  
    
      [null,null,["Last updated 2020-10-01 UTC."],[],[]]