Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.
Closed
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
17 changes: 3 additions & 14 deletions Sources/DeepLearning/Operators.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,6 @@ public extension Padding {
case .valid: return .valid
}
}

@inlinable
internal var raw2: Raw.Padding2 {
switch self {
case .same: return .same
case .valid: return .valid
}
}
}

public extension Tensor where Scalar: TensorFlowFloatingPoint {
Expand All @@ -143,8 +135,7 @@ public extension Tensor where Scalar: TensorFlowFloatingPoint {
filter: filter,
outBackprop: self,
strides: [strides.0, strides.1, strides.2, strides.3],
padding: padding.raw2,
explicitPaddings: [])
padding: padding.raw)
}

/// TensorFlow builtin conv2d gradient helper for the filter.
Expand All @@ -161,8 +152,7 @@ public extension Tensor where Scalar: TensorFlowFloatingPoint {
filterSizes: filterSizes,
outBackprop: self,
strides: [strides.0, strides.1, strides.2, strides.3],
padding: padding.raw2,
explicitPaddings: [])
padding: padding.raw)
}

@inlinable
Expand Down Expand Up @@ -292,8 +282,7 @@ public extension Tensor where Scalar: FloatingPoint {
self,
filter: filter,
strides: [strides.0, strides.1, strides.2, strides.3],
padding: padding.raw2,
explicitPaddings: [])
padding: padding.raw)
}

/// Computes a 2-D max pooling, with the specified kernel sizes, strides, and
Expand Down