torch.distributions.toTensor
function toTensor(value: number | Tensor | number[] | boolean | boolean[], options?: { dtype?: DType; device?: 'cpu' | 'webgpu' }): TensorConvert a number or tensor to a tensor. If already a tensor, returns as-is. If a number, creates a scalar tensor.
Parameters
valuenumber | Tensor | number[] | boolean | boolean[]options{ dtype?: DType; device?: 'cpu' | 'webgpu' }optional