Skip to content

Commit

Permalink
🐛 fix: input GPU check (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-francoisreboud authored Aug 9, 2023
1 parent bc563a7 commit 424cd06
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

## [unreleased]

## 0.3.1 (2023-08-09)

### Bug Fixes

🐛 **fix**: input GPU check ([#106](https://github.com/owkin/GrAIdient/pull/106))

## 0.3.0 (2023-08-04)

### Features
Expand Down
2 changes: 1 addition & 1 deletion Sources/GrAIdient/Layer1D/Base/LayerInput1D.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ open class LayerInput1D: Layer1D
batchSize: Int,
nbNeurons: Int) throws
{
if data.nbElems > batchSize * nbNeurons
if batchSize * nbNeurons > data.nbElems
{
throw LayerError.DataSize
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/GrAIdient/Layer2D/Base/LayerInput2D.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ open class LayerInput2D: Layer2D
batchSize: Int,
nbChannels: Int, height: Int, width: Int) throws
{
if data.nbElems > batchSize * nbChannels * height * width
if batchSize * nbChannels * height * width > data.nbElems
{
throw LayerError.DataSize
}
Expand Down

0 comments on commit 424cd06

Please sign in to comment.