Skip to content

Document and test input_dtype and output_dtype policy #350

@Michael-T-McCann

Description

@Michael-T-McCann

We should decide what input_dtype and output_dtype mean, then document it.

Proposed input_dtype and output_dtype policy:

  • All instantiated Operators must have input_dtype and output_dtype properties
    • Possible data types are snp.float32, snp.float64, snp.complex64
  • at the level of Operator, we should call snp.dtype(input_dtype) to make sure it is a dtype and not a type
    • compare print(snp.float32) and print(snp.dtype(snp.float32)), second has nice repl
  • For an Operator H, H(x) should throw an error if x.dtype is not input_dtype
    • Instead: how about input_dtype is the "largest" dtype allowed, passing a "smaller" one is allowed
      • Would this still work on the adjoint? NO, so largest dtype does not work
  • Operators should be written so that H(x).dtype is H.output_dtype; this will not be checked and runtime, but should be tested
  • Operators should attempt to automatically deduce input_dtype and output_dtype from other arguments and throw an error if the user requests an input_dtype or output_dtype that is not realizable

This policy should be described in the docs and implemented in the code.

Related: #165 #234

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussion requiredSome discussion necessary to decide how to address this issuedocumentationImprovements or additions to documentationtestsPertaining to SCICO tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions