Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 117 for set_shape (0.23 sec)

  1. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_layout_helper.cc

        ArrayRef<int64_t> shape = ranked_type.getShape();
        assert(permutation.size() == shape.size());
    
        SmallVector<int64_t, 4> new_shape(permutation.size());
        for (size_t i = 0; i < permutation.size(); ++i)
          new_shape[i] = shape[permutation[i]];
    
        return RankedTensorType::get(new_shape, ranked_type.getElementType());
      }
    
      return type;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/passes/preprocess_op.cc

        auto new_shape_const_attr =
            DenseElementsAttr::get(shape_spec_type, new_shape.getShape());
        rewriter.setInsertionPointAfter(weight_op);
        auto new_shape_const = rewriter.create<arith::ConstantOp>(
            weight_op->getLoc(), shape_spec_type, new_shape_const_attr);
        auto reshape_op = rewriter.create<TF::ReshapeOp>(
            weight_op->getLoc(), new_shape, weight_op->getResult(0),
            new_shape_const);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/transforms/push_transpose_through_ewise.cc

                                            llvm::ArrayRef<int32_t> perm) {
      llvm::SmallVector<int64_t> new_shape(shape.size());
      for (const auto &perm_element : enumerate(perm)) {
        new_shape[perm_element.index()] = shape[perm_element.value()];
      }
      return new_shape;
    }
    
    // Determine if op commutes with transposes. Requires a strict
    // definition of Elementwise, all i/o shapes and types must be same-rank
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tf2xla/transforms/legalize_tf.cc

          //   [H, W, ..., filter_in_depth, G, out_depth / G].
          auto new_shape = llvm::to_vector<6>(filter_shape);
          new_shape.back() = feature_group_count;
          new_shape.push_back(filter_shape.back() / feature_group_count);
          Type filter_element_ty = filter_ty.getElementType();
          auto ty =
              tensorflow::GetTypeFromTFTensorShape(new_shape, filter_element_ty);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 20:00:43 UTC 2024
    - 291.8K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/ir/tfl_ops.cc

              value_attr.getValues<Attribute>()[outer_index * inner_dims_size + i]);
        }
      }
    
      std::vector<int64_t> new_shape = value_attr.getType().getShape().vec();
      new_shape[0] = lookup_attr.getType().getShape()[0];
      auto new_type = value_attr.getType().clone(new_shape);
    
      return DenseElementsAttr::get(new_type, new_values);
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 02 09:41:17 UTC 2024
    - 169.2K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_n_z.cc

        } else {
          output_ty = tensorflow::GetTypeFromTFTensorShape(
              {static_cast<int64_t>(sub_shape.size())}, output_elt_ty);
        }
      }
    
      // Down-cast to 32 bit int if needed.
      if (output_elt_ty.isInteger(32)) {
        SmallVector<int32_t, 2> sub_shape_i32(sub_shape.size());
        std::transform(sub_shape.begin(), sub_shape.end(), sub_shape_i32.begin(),
                       [](int64_t d) { return static_cast<int32_t>(d); });
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 22:07:10 UTC 2024
    - 170.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.cc

          return {};
        }
      } else if ((new_shape.size() == shape.size() + 1) && new_shape.front() == 1) {
        // Handle the [A, B, C] -> [1, A, B, C] reshape case.
        if (!(std::equal(shape.begin(), shape.end(), new_shape.begin() + 1) &&
              quant_dim == new_shape.size() - 1)) {
          return {};
        }
      } else {
        return {};
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/tests/tf_to_hlo_pipeline/sccp-post-shape-inference.mlir

        %2 = "tf.PartitionedCall"(%1) {config = "", config_proto = "", executor_type = "", f = @get_shape} : (tensor<?x?xf32>) -> (tensor<?xi64>)
    
        // CHECK: return %[[RESULT]]
        func.return %2 : tensor<?xi64>
      }
    
      // CHECK-LABEL: func @get_shape
      func.func @get_shape(%arg0 : tensor<*xi64>) -> tensor<?xi64> {
        %0 = "tf.Shape"(%arg0) : (tensor<*xi64>) -> tensor<?xi64>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jul 25 02:54:34 UTC 2023
    - 1020 bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/stablehlo/transforms/uniform_quantized_stablehlo_to_tfl_pass.cc

                                           /*shape=*/new_shape,
                                           /*type=*/new_filter_quantized_type);
        } else if (element_type.isa<UniformQuantizedType>()) {
          auto per_tensor_type = element_type.cast<UniformQuantizedType>();
          new_filter_result_type =
              RankedTensorType::getChecked(location,
                                           /*shape=*/new_shape,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 09:00:19 UTC 2024
    - 99.8K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/lower_tf.cc

        if (!input_ty.hasRank() || input_ty.getRank() != 4) {
          return failure();
        }
    
        int64_t batch_cst = input_ty.getShape()[0];
        int64_t channels_cst = input_ty.getShape()[3];
    
        int64_t in_y_cst = input_ty.getShape()[1];
        int64_t in_x_cst = input_ty.getShape()[2];
        int64_t in_spatial_cst =
            in_y_cst < 0 || in_x_cst < 0 ? -1 : in_y_cst * in_x_cst;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 74.9K bytes
    - Viewed (0)
Back to top