Skip to content

[SR-9448] [AD] Diagnose @autodiff function types whose parameters or results don't conform to Differentiable #51912

@rxwei

Description

@rxwei
Previous ID SR-9448
Radar None
Original Reporter @rxwei
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Swift for TensorFlow
Labels Bug
Assignee pschuh (JIRA)
Priority Medium

md5: befdfabb4c9c4f81ed793d918da2b9d7

Issue Description:

Test case

struct NonDiffType { var x: Int }
// expected-error @+1 {{argument is not differentiable, but the enclosing function type is marked '@autodiff'; did you want to add '@nondiff' to this argument?}}
let _: @autodiff (NonDiffType) -> Float
// expected-error @+1 {{result is not differentiable, but the enclosing function type is marked '@autodiff'; did you want to add '@nondiff' to this argument?}}
let _: @autodiff (Float) -> NonDiffType

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.swift for tensorflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions