用法:
mxnet.ndarray.sparse.retain(data=None, indices=None, out=None, name=None, **kwargs)
out:- 此函數的輸出。
NDArray 或 NDArray 列表
參數:
返回:
返回類型:
從行稀疏矩陣中選擇用戶輸入索引數組指定的行並將它們保存在輸出稀疏矩陣中。
例子:
data = [[1, 2], [3, 4], [5, 6]] indices = [0, 1, 3] shape = (4, 2) rsp_in = row_sparse_array(data, indices) to_retain = [0, 3] rsp_out = retain(rsp_in, to_retain) rsp_out.data = [[1, 2], [5, 6]] rsp_out.indices = [0, 3]
retain
輸出的存儲類型取決於輸入的存儲類型- 保留(row_sparse,默認)=row_sparse
- 否則,不支持
retain
相關用法
- Python mxnet.ndarray.sparse.row_sparse_array用法及代碼示例
- Python mxnet.ndarray.sparse.rsqrt用法及代碼示例
- Python mxnet.ndarray.sparse.rint用法及代碼示例
- Python mxnet.ndarray.sparse.round用法及代碼示例
- Python mxnet.ndarray.sparse.trunc用法及代碼示例
- Python mxnet.ndarray.sparse.broadcast_mul用法及代碼示例
- Python mxnet.ndarray.sparse.sgd_update用法及代碼示例
- Python mxnet.ndarray.sparse.broadcast_plus用法及代碼示例
- Python mxnet.ndarray.sparse.RowSparseNDArray用法及代碼示例
- Python mxnet.ndarray.sparse.sign用法及代碼示例
- Python mxnet.ndarray.sparse.concat用法及代碼示例
- Python mxnet.ndarray.sparse.make_loss用法及代碼示例
- Python mxnet.ndarray.sparse.adagrad_update用法及代碼示例
- Python mxnet.ndarray.sparse.exp用法及代碼示例
- Python mxnet.ndarray.sparse.square用法及代碼示例
- Python mxnet.ndarray.sparse.clip用法及代碼示例
- Python mxnet.ndarray.sparse.zeros_like用法及代碼示例
- Python mxnet.ndarray.sparse.Embedding用法及代碼示例
- Python mxnet.ndarray.sparse.divide用法及代碼示例
- Python mxnet.ndarray.sparse.CSRNDArray用法及代碼示例
注:本文由純淨天空篩選整理自apache.org大神的英文原創作品 mxnet.ndarray.sparse.retain。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。