Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 52 for replaceMap (0.36 sec)

  1. tensorflow/compiler/mlir/tensorflow/transforms/tfg-to-tfe.cc

        rewriter.create<tf_executor::FetchOp>(loc);
    
        // Add terminator of func
        rewriter.setInsertionPointToEnd(&func.getBody().front());
        rewriter.create<func::ReturnOp>(loc);
    
        rewriter.replaceOp(graph.getOperation(), func.getOperation()->getResults());
    
        return success();
      }
    };
    
    class ConvertGraphFuncOp : public OpConversionPattern<tfg::GraphFuncOp> {
     public:
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/push_transpose_through_ewise.cc

        auto out_tpose_op = rewriter.create<TFL::TransposeOp>(
            new_ewise_op->getLoc(), op->getResult(0).getType(),
            new_ewise_op->getResults()[0], perm1);
        rewriter.replaceOp(op, out_tpose_op.getOperation());
        return success();
      }
    };
    
    // ewise(tpose(x), y) -> tpose(ewise(x, tpose^{-1}(y)))
    //  iff y is const and tpose(x) has one use.
    //
    // Proof:
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_stablehlo_custom_call_to_composite.cc

        auto composite = rewriter.create<mlir::stablehlo::CompositeOp>(
            op.getLoc(), op.getResultTypes(), op.getOperands(), name.str(), attrs,
            decomposition.getValue());
        rewriter.replaceOp(op, composite.getResults());
        return success();
      }
    };
    
    struct LegalizeStablehloCustomCallToCompositePass
        : public impl::LegalizeStablehloCustomCallToCompositePassBase<
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/convert_tf_quant_types.cc

          rewriter.inlineRegionBefore(region, new_region, new_region.begin());
          if (failed(rewriter.convertRegionTypes(&new_region, *getTypeConverter())))
            return failure();
        }
        rewriter.replaceOp(op, rewriter.create(state)->getResults());
    
        // TODO: b/290366702 - Temporarily added metrics for debugging.
        mlir_tf_quant_op_count->GetCell(std::string(op->getName().getStringRef()))
            ->IncrementBy(1);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tfrt/ir/tfrt_fallback_async.cc

                      operand, op->getAttrOfType<mlir::StringAttr>("device"))
                  .getResult(0));
        }
    
        if (!should_rewrite) return failure();
        rewriter.replaceOp(op, new_values);
        return success();
      }
    };
    
    // Removes the following double tensor conversion:
    //  %1 = tfrt_fallback_async.fallback_tensor_to_corert_tensorhandle %0
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jun 08 01:19:25 UTC 2023
    - 15.6K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/transforms/decompose_hybrid_quantization.cc

                loc, resultTy, result, TypeAttr::get(resultTy)));
            continue;
          }
    
          replaceResults.push_back(result);
        }
    
        rewriter.replaceOp(op, replaceResults);
    
        return success();
      }
    };
    
    void DecomposeHybridQuantizationPass::runOnOperation() {
      RewritePatternSet patterns(&getContext());
      auto *ctx = &getContext();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tfr/passes/canonicalize.cc

          }
          rewriter.eraseOp(terminator_op);
        }
        SmallVector<Value, 4> returned;
        for (Value arg : for_op.getRegionIterArgs()) {
          returned.push_back(mapping.lookup(arg));
        }
        rewriter.replaceOp(for_op, returned);
        return success();
      }
    };
    
    // TODO(fengliuai): up stream this pattern.
    class SimplifySCFIfOp : public OpRewritePattern<scf::IfOp> {
      using OpRewritePattern<scf::IfOp>::OpRewritePattern;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Jan 14 22:15:06 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tfr/ir/tfr_ops.cc

          new_cst = rewriter.create<TF::ConstOp>(loc, new_out_type, attr);
          if (out_type.isa<TFRTensorType>()) {
            new_cst = rewriter.create<CastOp>(loc, out_type, new_cst->getResult(0));
          }
          rewriter.replaceOp(cst_tensor_op, new_cst->getResult(0));
          return success();
        }
    
        TypedAttr scalar;
        if (matchPattern(cst_tensor_op.getArg(), m_Constant(&scalar))) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Nov 21 16:55:41 UTC 2023
    - 38.2K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/transforms/optimize.cc

            inner_reshape_op->getLoc(),
            inner_reshape_input, new_reshape_shape_value);
    
        // Create a new reshape_op to replace the old inner reshape_op.
        rewriter.replaceOp(inner_reshape_op, new_inner_reshape_op.getResult());
    
        // Get the new shape for the broadcast_op after removing the extra 1s.
        llvm::SmallVector<int64_t, 6> new_broadcast_shape{
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 30 00:40:15 UTC 2024
    - 102.3K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/transforms/prepare_tf.cc

        }
        auto conv_op = static_cast<const ConcreteType *>(this)->createTFLOp(
            &state, rewriter, op->getLoc(), tf_op.getType(), input, filter, bias);
    
        rewriter.replaceOp(op, conv_op.getResult());
        return success();
      }
    
      const IntegerAttr intAttrOne;
    
     private:
      bool allow_bf16_and_f16_type_legalization_;
    };
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 21:49:50 UTC 2024
    - 64.6K bytes
    - Viewed (0)
Back to top