tensorflow:: ops:: Restore

#include <io_ops.h>

チェックポイントファイルからテンソルを復元します。

まとめ

1つまたは複数のファイルに保存されているテンソルを読み取ります。ファイルが複数ある場合(例えば、テンソルがスライスとして保存されている場合)、 file_patternはファイル名の部分のみにワイルドカード記号( *と? )を含めることができ、ディレクトリの部分には含めることはできません。

file_pattern複数のファイルに一致する場合、 preferred_shard使用して、要求されたテンソルがどのファイルにある可能性が高いかをヒントとして使用できます。この操作では、まず一致するファイルのリストのpreferred_shardのインデックスにあるファイルを開き、そのファイルからテンソルを復元しようとします。最初のファイルで一部のテンソルまたはテンソルスライスが見つからない場合にのみ、操作はすべてのファイルを開きます。preferred_shard preferred_shard一致するSave操作のshard入力として渡された値と一致するように設定すると、 Restore が高速化される場合があります。この属性はパフォーマンスにのみ影響し、正確性には影響しません。デフォルト値 -1 は、ファイルが順番に処理されることを意味します。

RestoreSliceも参照してください。

議論:

  • スコープ:スコープオブジェクト
  • file_pattern: 要素は1つだけである必要があります。テンソルを読み込むファイルのパターンを指定します。
  • tensor_name: 要素は1つだけである必要があります。復元するテンソルの名前を指定します。
  • dt: 復元するテンソルの型。

オプション属性( Attrs参照):

  • preferred_shard: file_pattern一致する複数のファイルがある場合に最初に開くファイルのインデックス。

返品:

  • Output :復元されたテンソル。

コンストラクターとデストラクタ

Restore (const :: tensorflow::Scope & scope, :: tensorflow::Input file_pattern, :: tensorflow::Input tensor_name, DataType dt)
Restore (const :: tensorflow::Scope & scope, :: tensorflow::Input file_pattern, :: tensorflow::Input tensor_name, DataType dt, const Restore::Attrs & attrs)

公開属性

operation
tensor

公的機能

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

パブリック静的関数

PreferredShard (int64 x)

構造

tensorflow:: ops:: Restore:: Attrs

Restoreのオプション属性セッター。

公開属性

手術

Operation operation

テンソル

::tensorflow::Output tensor

公的機能

復元する

 Restore(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input file_pattern,
  ::tensorflow::Input tensor_name,
  DataType dt
)

復元する

 Restore(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input file_pattern,
  ::tensorflow::Input tensor_name,
  DataType dt,
  const Restore::Attrs & attrs
)

ノード

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

パブリック静的関数

優先シャード

Attrs PreferredShard(
  int64 x
)