megengine.Parameter¶
-
class
Parameter
(data, dtype=None, device=None, is_const=False, no_cache=False, name=None)[源代码]¶ 基类:
megengine.tensor.Tensor
一类表示模块参数的张量。
方法
__init__
(data[, dtype, device, is_const, …])初始化方法。
astype
(dtype)Returns a
Tensor
with the same data and number of elements with the specifieddtype
.detach
()Returns a new
Tensor
, detached from the current graph.flatten
()See
flatten
.item
(*args)Returns the value of this
Tensor
as a standard Pythonnumbers.Number
.max
([axis, keepdims])Returns the max value of each row of the input tensor in the given dimension
axis
.mean
([axis, keepdims])Returns the mean value of each row of the input tensor in the given dimension
axis
.min
([axis, keepdims])Returns the min value of each row of the input tensor in the given dimension
axis
.numpy
()Returns self
Tensor
as anumpy.ndarray
.prod
([axis, keepdims])Returns the product of each row of the input tensor in the given dimension
axis
.reset_zero
()1.0 版后已移除.
reshape
(*args)See
reshape
.set_value
(value)1.0 版后已移除.
sum
([axis, keepdims])Returns the sum of each row of the input tensor in the given dimension
axis
.to
(device)Copy self
Tensor
to specified device.tolist
()Returns the tensor as a (nested) list.
transpose
(*args)See
transpose
.属性。
T
alias of
transpose
.c_name
device
Returns a string represents the device a
Tensor
storaged on.dmap_callback
dtype
Returns a
numpy.dtype
object represents the data type of aTensor
.grad
name
ndim
返回自身
Tensor
的维数。qparams
Returns a
QParams
object containing quantization params of aTensor
.requires_grad
shape
size
Returns the size of the self
Tensor
.