neuralop.utils.count_tensor_params

neuralop.utils.count_tensor_params(tensor, dims=None)[source]

Returns the number of parameters (elements) in a single tensor, optionally, along certain dimensions only

Parameters:
tensortorch.tensor
dimsint list or None, default is None

if not None, the dimensions to consider when counting the number of parameters (elements)

Notes

One complex number is counted as two parameters (we count real and imaginary parts)’