Пример #1
0
            private static Tensor __randn(Tensor t)
            {
                switch (t.dtype)
                {
                case torch.float16:
                {
                    MKL.Randn(t.__half);
                    return(t);
                }

                case torch.float32:
                {
                    MKL.Randn(t.__float);
                    return(t);
                }

                case torch.float64:
                {
                    MKL.Randn(t.__double);
                    return(t);
                }

                case torch.int8:
                case torch.uint8:
                case torch.int16:
                case torch.int32:
                case torch.int64:
                {
                    throw new TorchException("TorchException: torch.randn is not implemented for integer tensors.");
                }

                case torch.@bool:
                {
                    throw new TorchException("TorchException: torch.randn is not implemented for bool tensors.");
                }
                }
                return(t);
            }