def _ones_like(batch, precision): ''' Returns a new batch, which has the same format as ``batch`` but all values set to 1. Args: batch (list of NumPy arrays): a list of sequences, which are NumPy arrays ''' from cntk.internal import sanitize_precision return [np.ones_like(sample, dtype=sanitize_precision(precision)) for sample in batch]
def dtype(self): ''' The NumPy type of this variable. ''' return sanitize_precision(self.get_data_type())