用法:
slice_assign(rhs, begin, end, step)
- rhs:(
NDArray.
) - rhs 和這個 NDArray 應該是相同的數據類型,並且在同一個設備上。 rhs 的形狀應與此 NDArray 的裁剪形狀相同。 - begin:(
tuple of begin indices
) - - end:(
tuple of end indices
) - - step:(
tuple of step lenghths
) -
- rhs:(
這個 NDArray。
參數:
返回:
返回類型:
將 rhs 分配給該 NDarray 的裁剪子集。返回此 NDArray 的視圖。
例子:
>>> x = nd.ones((2, 2, 2)) >>> assigned = nd.zeros((1, 1, 2)) >>> y = x.slice_assign(assigned, (0, 0, None), (1, 1, None), (None, None, None)) >>> y [[[0. 0.] [1. 1.]]
[[1。 1.] [1. 1.]]] <NDArray 2x2x2 @cpu(0)> >>> x [[[0. 0.] [1. 1.]]
[[1。 1.] [1. 1.]]] <NDArray 2x2x2 @cpu(0)>
相關用法
- Python mxnet.ndarray.NDArray.slice_assign_scalar用法及代碼示例
- Python mxnet.ndarray.NDArray.size用法及代碼示例
- Python mxnet.ndarray.NDArray.shape用法及代碼示例
- Python mxnet.ndarray.NDArray.ndim用法及代碼示例
- Python mxnet.ndarray.NDArray.reshape用法及代碼示例
- Python mxnet.ndarray.NDArray.ctx用法及代碼示例
- Python mxnet.ndarray.NDArray.copy用法及代碼示例
- Python mxnet.ndarray.NDArray.to_dlpack_for_write用法及代碼示例
- Python mxnet.ndarray.NDArray.flatten用法及代碼示例
- Python mxnet.ndarray.NDArray.to_dlpack_for_read用法及代碼示例
- Python mxnet.ndarray.NDArray.broadcast_to用法及代碼示例
- Python mxnet.ndarray.NDArray.astype用法及代碼示例
- Python mxnet.ndarray.NDArray.expand_dims用法及代碼示例
- Python mxnet.ndarray.NDArray.broadcast_like用法及代碼示例
- Python mxnet.ndarray.NDArray.copyto用法及代碼示例
- Python mxnet.ndarray.NDArray.dtype用法及代碼示例
- Python mxnet.ndarray.NDArray.as_in_context用法及代碼示例
- Python mxnet.ndarray.NDArray.asscalar用法及代碼示例
- Python mxnet.ndarray.NDArray.T用法及代碼示例
- Python mxnet.ndarray.NDArray.asnumpy用法及代碼示例
注:本文由純淨天空篩選整理自apache.org大神的英文原創作品 mxnet.ndarray.NDArray.slice_assign。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。