Exemplo n.º 1
0
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]
Exemplo n.º 2
0
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]
Exemplo n.º 3
0
 def dtype(self):
     '''
     The NumPy type of this variable.
     '''
     return sanitize_precision(self.get_data_type())
Exemplo n.º 4
0
 def dtype(self):
     '''
     The NumPy type of this variable.
     '''
     return sanitize_precision(self.get_data_type())