コード例 #1
0
ファイル: utils.py プロジェクト: AllanYiin/CNTK
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]
コード例 #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]
コード例 #3
0
 def dtype(self):
     '''
     The NumPy type of this variable.
     '''
     return sanitize_precision(self.get_data_type())
コード例 #4
0
ファイル: variables.py プロジェクト: BorisJineman/CNTK
 def dtype(self):
     '''
     The NumPy type of this variable.
     '''
     return sanitize_precision(self.get_data_type())