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

[SR-9656] [AD] [SILGen] Differentiable protocol requirement SILGen crasher #52100

Closed
rxwei opened this issue Jan 14, 2019 · 1 comment
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. swift for tensorflow

Comments

@rxwei
Copy link
Member

rxwei commented Jan 14, 2019

Previous ID SR-9656
Radar None
Original Reporter @rxwei
Type Bug
Status Resolved
Resolution Cannot Reproduce
Additional Detail from JIRA
Votes 0
Component/s Swift for TensorFlow
Labels Bug
Assignee @dan-zheng
Priority Medium

md5: fdd1c40624717c963bd1034a5e72b878

Issue Description:

public protocol Layer: Differentiable {
  /// The input type of the layer.
  associatedtype Input: TensorGroup & Differentiable
  /// The output type of the layer.
  associatedtype Output: TensorGroup & Differentiable

  /// Returns the output obtained from applying to an input.
  @differentiable(wrt: (self, .0))
  func applied(to input: Input) -> Output
}

struct Classifier : Layer {
  var w1 = Tensor<Float>(randomUniform: [2, 4])
  var w2 = Tensor<Float>(randomUniform: [4, 1])
  var b1 = Tensor<Float>(zeros: [1, 4])
  var b2 = Tensor<Float>(zeros: [1, 1])
  func applied(to input: Tensor<Float>) -> Tensor<Float> {
    let o1 = sigmoid(matmul(input, w1) + b1)
    return sigmoid(matmul(o1, w2) + b2)
  }
}

@dan-zheng believes that it's because `CheckedParameterIndices` was not serialized. Merging #21837 may fix this.

@rxwei
Copy link
Member Author

rxwei commented Jan 17, 2019

Should be fixed now after serialization fixes

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. swift for tensorflow
Projects
None yet
Development

No branches or pull requests

1 participant