Skip to content

Commit

Permalink
Add passing test that includes Torch and TensorFlow together
Browse files Browse the repository at this point in the history
Signed-off-by: Mattt Zmuda <[email protected]>
  • Loading branch information
bfirsh authored and mattt committed Jun 22, 2023
1 parent ed679ac commit c62dd43
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,33 @@ foo==1.0.0`
require.Equal(t, expected, requirements)
}

func TestPythonPackagesBothTorchAndTensorflow(t *testing.T) {
config := &Config{
Build: &Build{
GPU: true,
PythonVersion: "3.11.1",
PythonPackages: []string{
"tensorflow==2.12.0",
"torch==2.0.1",
"torchvision==0.15.2",
},
CUDA: "11.8",
},
}
err := config.ValidateAndComplete("")
require.NoError(t, err)
require.Equal(t, "11.8", config.Build.CUDA)
require.Equal(t, "8", config.Build.CuDNN)

requirements, err := config.PythonRequirementsForArch("", "")
require.NoError(t, err)
expected := `--extra-index-url https://download.pytorch.org/whl/cu118
tensorflow==2.12.0
torch==2.0.1+cu118
torchvision==0.15.2`
require.Equal(t, expected, requirements)
}

func TestCUDABaseImageTag(t *testing.T) {
config := &Config{
Build: &Build{
Expand Down

0 comments on commit c62dd43

Please sign in to comment.