Skip to content

Fix TensorFlow module compilation. #28023

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

Conversation

dan-zheng
Copy link
Contributor

@dan-zheng dan-zheng commented Nov 1, 2019

Fix KeyPathIterable derived conformances: KeyPathIterable.allKeyPaths
synthesis logic now requires different key-path expression coercion logic
to accommodate upstream type-checker changes.


Summary:

// Generated code for `KeyPathIterable.allKeyPaths`.
var allKeyPaths: [PartialKeyPath<Self>] {
  // Ideal code: TF-575.
  // error: cannot convert parent type 'main.TF575_LayerNorm<Scalar>' to expected type 'main.TF575_LayerNorm<Scalar>'
  [\Self.offset, \Self.scale]

  // Previously working code before swift-DEVELOPMENT-SNAPSHOT-2019-10-24-a.
  // error: cannot convert value of type '[WritableKeyPath<TF575_LayerNorm<Scalar>.TangentVector, Tensor<Scalar>>]' to type 'Array<Element>' in coercion
  // [\Self.offset, \Self.scale] as [PartialKeyPath<Self>]

  // Newly generated code.
  // [\Self.offset as PartialKeyPath<Self>, \Self.scale as PartialKeyPath<Self>]
}

See TF-575 for more information.
I'll minimize the type-checker issues and file upstream bugs.

Fix `KeyPathIterable` derived conformances: `KeyPathIterable.allKeyPaths`
synthesis logic now uses different key-path expression coercion logic
to accommodate upstream type-checker changes.

See TF-575 for more information.
@dan-zheng dan-zheng added the tensorflow This is for "tensorflow" branch PRs. label Nov 1, 2019
@dan-zheng dan-zheng requested review from pschuh and marcrasi November 1, 2019 22:36
Copy link
Contributor

@pschuh pschuh left a comment

Choose a reason for hiding this comment

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

Test?

@dan-zheng
Copy link
Contributor Author

Test?

Done in 9efd87e.

@dan-zheng
Copy link
Contributor Author

@swift-ci Please clean test tensorflow

@dan-zheng
Copy link
Contributor Author

TensorFlow module now compiles.

Remaining test failures:

Failing Tests (10):
    Swift(linux-x86_64) :: SILOptimizer/invalid_escaping_captures.swift
    Swift(linux-x86_64) :: SILOptimizer/infinite_recursion.swift
    Swift(linux-x86_64) :: SILOptimizer/exclusivity_static_diagnostics.swift
    Swift(linux-x86_64) :: SILOptimizer/generalized_accessors.swift
    Swift(linux-x86_64) :: SILOptimizer/noescape_param_exclusivity.swift
    Swift(linux-x86_64) :: SILOptimizer/diagnostic_constant_propagation_int_arch64.swift
    Swift(linux-x86_64) :: SILOptimizer/definite_init_failable_initializers_diagnostics.swift
    Swift(linux-x86_64) :: SILOptimizer/definite_init_diagnostics.swift
    Swift(linux-x86_64) :: SILOptimizer/mandatory_inlining.swift
    Swift(linux-x86_64) :: SILOptimizer/constant_propagation_diagnostics.swift

@dan-zheng dan-zheng merged commit 685b30c into swiftlang:tensorflow-merge Nov 4, 2019
@dan-zheng dan-zheng deleted the tensorflow-merge-fix-keypathiterable branch November 4, 2019 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tensorflow This is for "tensorflow" branch PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants