tensorflow/compiler/mlir/tensorflow/analysis/side_effect_analysis.cc
// Returns all resources that could be accessed by op, or UnknownResourceSet()
// if we cannot find all of them.
Returns all resources that could be accessed by op, or UnknownResourceSet()
if we cannot find all of them.
Returns all resources that could be accessed by op or UnknownResourceSet () if we cannot find all of them .
llvm::SmallDenseSet<int64_t, 8> FindAccessedResources(
    Operation* op, const ResourceAliasAnalysis& alias_analysis) {
  llvm::SmallDenseSet<int64_t, 8> resources;
  for (auto operand : op->getOperands()) {
    if (!mlir::getElementTypeOrSelf(operand.getType()).isa<TF::ResourceType>())
      continue;
    if (alias_analysis.IsUnknownResource(operand)) return UnknownResourceSet();
    const auto& ids = alias_analysis.GetResourceUniqueIds(operand);
    resources.insert(ids.begin(), ids.end());
  }
  for (auto result : op->getResults()) {
    if (!mlir::getElementTypeOrSelf(result.getType()).isa<TF::ResourceType>())
      continue;
    if (alias_analysis.IsUnknownResource(result)) return UnknownResourceSet();
    const auto& ids = alias_analysis.GetResourceUniqueIds(result);
    resources.insert(ids.begin(), ids.end());
  }
  return resources;
}
llvm :: SmallDenseSet < int64_t , 8 > FindAccessedResources ( Operation * op , const ResourceAliasAnalysis & alias_analysis ) { llvm :: SmallDenseSet < int64_t , 8 > resources ; for ( auto operand : op -> getOperands ( ) ) { if ( ! mlir :: getElementTypeOrSelf ( operand . getType ( ) ) . isa < TF :: ResourceType > ( ) ) continue ; if ( alias_analysis . IsUnknownResource ( operand ) ) return UnknownResourceSet ( ) ; const auto & ids = alias_analysis . GetResourceUniqueIds ( operand ) ; resources . insert ( ids . begin ( ) , ids . end ( ) ) ; } for ( auto result : op -> getResults ( ) ) { if ( ! mlir :: getElementTypeOrSelf ( result . getType ( ) ) . isa < TF :: ResourceType > ( ) ) continue ; if ( alias_analysis . IsUnknownResource ( result ) ) return UnknownResourceSet ( ) ; const auto & ids = alias_analysis . GetResourceUniqueIds ( result ) ; resources . insert ( ids . begin ( ) , ids . end ( ) ) ; } return resources ; }
Returns all resources that could be accessed by op, or UnknownResourceSet()
if we cannot find all of them.
Returns all resources that could be accessed by op or UnknownResourceSet () if we cannot find all of them .