Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tensorflow/swift-apis as a SwiftPM dependency. #727

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 49 additions & 29 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,39 @@ let package = Package(
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.10.0"),
.package(url: "https://github.com/apple/swift-argument-parser", .branch("main")),
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
.package(url: "https://github.com/tensorflow/swift-apis", .branch("main")),
],
targets: [
.target(
name: "Checkpoints", dependencies: ["SwiftProtobuf", "ModelSupport"],
name: "Checkpoints", dependencies: ["TensorFlow", "SwiftProtobuf", "ModelSupport"],
path: "Checkpoints"),
.target(name: "Datasets", dependencies: ["ModelSupport"], path: "Datasets"),
.target(name: "Datasets", dependencies: ["TensorFlow", "ModelSupport"], path: "Datasets"),
.target(name: "STBImage", path: "Support/STBImage"),
.target(
name: "ModelSupport", dependencies: ["STBImage"], path: "Support", exclude: ["STBImage"]),
.target(name: "TensorBoard", dependencies: ["SwiftProtobuf", "ModelSupport", "TrainingLoop"], path: "TensorBoard"),
.target(name: "ImageClassificationModels", path: "Models/ImageClassification"),
.target(name: "VideoClassificationModels", path: "Models/Spatiotemporal"),
.target(name: "TextModels",
name: "ModelSupport", dependencies: ["TensorFlow", "STBImage"], path: "Support",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While doing this, it might be nice to format this as:

.target(
  name: "ModelSupport",
  dependencies: [
    "TensorFlow",
    "STBImage",
  ],
  path: "Support"),

and similarly throughout. It makes it easier to read at a glance due to the one-item per line. It also makes future changes trivial to read.

exclude: ["STBImage"]),
.target(
name: "TensorBoard",
dependencies: ["TensorFlow", "SwiftProtobuf", "ModelSupport", "TrainingLoop"],
path: "TensorBoard"),
.target(
name: "ImageClassificationModels", dependencies: ["TensorFlow"],
path: "Models/ImageClassification"),
.target(
name: "VideoClassificationModels", dependencies: ["TensorFlow"],
path: "Models/Spatiotemporal"
),
.target(
name: "TextModels",
dependencies: ["Checkpoints", "Datasets", "SwiftProtobuf"],
path: "Models/Text"),
.target(name: "RecommendationModels", path: "Models/Recommendation"),
.target(
name: "RecommendationModels", dependencies: ["TensorFlow"],
path: "Models/Recommendation"),
.target(name: "TrainingLoop", dependencies: ["ModelSupport"], path: "TrainingLoop"),
.target(
name: "Autoencoder1D", dependencies: ["Datasets", "ModelSupport", "TrainingLoop", "AutoencoderCallback"],
name: "Autoencoder1D",
dependencies: ["Datasets", "ModelSupport", "TrainingLoop", "AutoencoderCallback"],
path: "Autoencoder/Autoencoder1D"),
.target(
name: "Autoencoder2D", dependencies: ["Datasets", "ModelSupport"],
Expand All @@ -56,15 +70,15 @@ let package = Package(
.target(
name: "AutoencoderCallback", dependencies: ["ModelSupport", "TrainingLoop"],
path: "Autoencoder/Callback"),
.target(name: "Catch", path: "Catch"),
.target(name: "Gym-FrozenLake", path: "Gym/FrozenLake"),
.target(name: "Gym-CartPole", path: "Gym/CartPole"),
.target(name: "Gym-Blackjack", path: "Gym/Blackjack"),
.target(name: "Gym-DQN", path: "Gym/DQN"),
.target(name: "Gym-PPO", path: "Gym/PPO"),
.target(name: "Catch", dependencies: ["TensorFlow"], path: "Catch"),
.target(name: "Gym-FrozenLake", dependencies: ["TensorFlow"], path: "Gym/FrozenLake"),
.target(name: "Gym-CartPole", dependencies: ["TensorFlow"], path: "Gym/CartPole"),
.target(name: "Gym-Blackjack", dependencies: ["TensorFlow"], path: "Gym/Blackjack"),
.target(name: "Gym-DQN", dependencies: ["TensorFlow"], path: "Gym/DQN"),
.target(name: "Gym-PPO", dependencies: ["TensorFlow"], path: "Gym/PPO"),
.target(
name: "VGG-Imagewoof",
dependencies: ["Datasets", "ImageClassificationModels", "TrainingLoop"],
dependencies: ["TensorFlow", "Datasets", "ImageClassificationModels", "TrainingLoop"],
path: "Examples/VGG-Imagewoof"),
.target(
name: "Regression-BostonHousing", dependencies: ["Datasets"],
Expand Down Expand Up @@ -97,7 +111,11 @@ let package = Package(
dependencies: ["Datasets", "ImageClassificationModels", "TrainingLoop", "TensorBoard"],
path: "Examples/ResNet50-ImageNet"),
.target(
name: "PersonLab", dependencies: ["Checkpoints", "ModelSupport", .product(name: "ArgumentParser", package: "swift-argument-parser")],
name: "PersonLab",
dependencies: [
"Checkpoints", "ModelSupport",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "PersonLab"),
.target(
name: "MiniGo", dependencies: ["Checkpoints"], path: "MiniGo", exclude: ["main.swift"]),
Expand Down Expand Up @@ -134,7 +152,7 @@ let package = Package(
name: "SwiftModelsBenchmarksCore",
dependencies: [
"Datasets", "ModelSupport", "ImageClassificationModels", "ArgumentParser",
"TextModels", "Benchmark"
"TextModels", "Benchmark",
],
path: "SwiftModelsBenchmarksCore"),
.target(
Expand All @@ -144,7 +162,9 @@ let package = Package(
),
.testTarget(name: "CheckpointTests", dependencies: ["Checkpoints"]),
.target(
name: "BERT-CoLA", dependencies: ["TextModels", "Datasets", "TrainingLoop"], path: "Examples/BERT-CoLA"),
name: "BERT-CoLA",
dependencies: ["x10_optimizers_optimizer", "TextModels", "Datasets", "TrainingLoop"],
path: "Examples/BERT-CoLA"),
.testTarget(name: "SupportTests", dependencies: ["ModelSupport"]),
.target(
name: "CycleGAN",
Expand All @@ -161,15 +181,15 @@ let package = Package(
dependencies: ["ArgumentParser", "Datasets", "ModelSupport", "TextModels"],
path: "Examples/WordSeg"
),
.target(
name: "Fractals",
dependencies: ["ArgumentParser", "ModelSupport"],
path: "Examples/Fractals"
),
.target(
name: "GrowingNeuralCellularAutomata",
dependencies: ["ArgumentParser", "ModelSupport"],
path: "Examples/GrowingNeuralCellularAutomata"
)
.target(
name: "Fractals",
dependencies: ["ArgumentParser", "ModelSupport"],
path: "Examples/Fractals"
),
.target(
name: "GrowingNeuralCellularAutomata",
dependencies: ["ArgumentParser", "ModelSupport"],
path: "Examples/GrowingNeuralCellularAutomata"
),
]
)