import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
# Check that MPS is availableifnot torch.backends.mps.is_available():ifnot torch.backends.mps.is_built():print("MPS not available because the current PyTorch install was not ""built with MPS enabled.")else:print("MPS not available because the current MacOS version is not 12.3+ ""and/or you do not have an MPS-enabled device on this machine.")else:device = torch.device("mps")
文章目录 今天的内容1.Stream【难点】1.1获取流的对象1.2Stream流对象下面1.2.1count和forEach1.2.2filter方法1.2.3limit1.2.4map方法1.2.5skip1.2.6concat 1.3收集流 1.基于接口和抽象类的匿名内部类的写法 abstract class Person {public abstract void eat();
}
public sta…
目录
前言
七、指针
7.1~3 指针与变量、指针操作、指向指针的指针
7.4 指针与数组
7.4.1 用指针标识数组
7.4.2 应注意的问题
a. 数组名是指针常量
b. 指针变量的当前值
c. 数组超界
7.4.3 多维数组与指针
7.4.4 指针数组
a. 指针数组
b. 数组指针
c. 对比总结 前…